Главная страница | назад





Article #15959: Ridding TEdit control of extraneous characters

 Question and Answer Database

FAQ959C.txt   Ridding TEdit  control of extraneous characters
Category   :OWL
Platform    :All
Product    :BC++  5.x

Question:

I'm having a problem with input fields using a windows dialog. 
The input length and end of data is filled with extraneous 
characters I don't know where they're coming from. 
I'm using GetText and SetText as well as
Pfname = new TEdit(this,IDC_NAME,35 + 1);
Pfname->SetText(this->record1.buff[0].pfname);
Pfname->GetText(record1.buff[0].pfname,35 + 1);

Answer:

OWL uses the Windows function GetWindowText(), 
which doesn't set the trailing '\0'.
You have to set it manually, using the number of chars actually 
read (returned by GetText()).

7/2/98 10:32:32 AM
 

Last Modified: 01-SEP-99