BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TEdit

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Jonathan Starr
Guest





PostPosted: Fri Jun 24, 2005 4:27 pm    Post subject: TEdit Reply with quote



I have a TEdit on a form, with an initial Text set using the
form designer. When I run my program in the IDE and refer
to the Text field of the TEdit, i.e., myTEdit->Text->c_str (),
the value returned is al3ways junk, even if I have repeatedly
typed in a new value on the form. However if I force the
debugger, at a breakpoint, to display the value of myTEdit->Text,
then the correct value is shown, and is also read by the program.

If I run without the IDE, I can never get the value to be read.

Any suggestions?
Back to top
Jonathan Starr
Guest





PostPosted: Fri Jun 24, 2005 4:40 pm    Post subject: Re: TEdit Reply with quote



Jonathan Starr wrote:

Quote:
I have a TEdit on a form, with an initial Text set using the
form designer. When I run my program in the IDE and refer
to the Text field of the TEdit, i.e., myTEdit->Text->c_str (),
the value returned is al3ways junk, even if I have repeatedly
typed in a new value on the form. However if I force the
debugger, at a breakpoint, to display the value of myTEdit->Text,
then the correct value is shown, and is also read by the program.

If I run without the IDE, I can never get the value to be read.

Any suggestions?

Additional info: If i create a new AnsiString based on the TEdit,
then everything works.

In other words, where Cindex is the TEdit, this fails:

char_p ptr = Cindex->Text.c_str ();

and this works:

AnsiString * foo = new AnsiString(Cindex->Text);
char_p ptr = foo->c_str ();

Some other TEdits on the same form work just fine.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.