Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Find the focused item in ListCtrl Pin
Tom Wright18-Jan-05 10:26
Tom Wright18-Jan-05 10:26 
GeneralRe: Find the focused item in ListCtrl Pin
Cyrus Dang18-Jan-05 10:37
Cyrus Dang18-Jan-05 10:37 
GeneralRe: Find the focused item in ListCtrl Pin
Serge Krynine18-Jan-05 12:38
Serge Krynine18-Jan-05 12:38 
GeneralRe: Find the focused item in ListCtrl Pin
Cyrus Dang18-Jan-05 12:43
Cyrus Dang18-Jan-05 12:43 
Generalcreating html file from MFC Pin
Member 143833718-Jan-05 10:11
Member 143833718-Jan-05 10:11 
GeneralRe: creating html file from MFC Pin
Shog918-Jan-05 11:03
sitebuilderShog918-Jan-05 11:03 
GeneralRe: creating html file from MFC Pin
vaibhavbvp3-Feb-13 18:18
vaibhavbvp3-Feb-13 18:18 
GeneralConverting Cstring to float Pin
Member 166473318-Jan-05 9:25
Member 166473318-Jan-05 9:25 
I'm trying to convert a Ctring that I read from an edit box into a float.
Here's the code I've got;

	CString result;<br />
	double d1;<br />
<br />
	GetDlgItemText(IDC_EDIT1, result);<br />
	char *txt = (char *) (LPCTSTR) result;<br />
	d1 = atof(txt);<br />


When I display txt I do see the correct decimal number, unfortunately d1 is truncated after to the first digit. I.e. if I enter 26.5 in the edit box (IDC_EDIT1), txt is 26.5 but d1 is only 2.
What I am doing wrong here?
Is there any easier way of reading a float from an edit box?
Cheers,
Pat.
GeneralRe: Converting Cstring to float Pin
Budric B.18-Jan-05 9:40
Budric B.18-Jan-05 9:40 
GeneralRe: Converting Cstring to float Pin
Tom Wright18-Jan-05 10:30
Tom Wright18-Jan-05 10:30 
GeneralRe: Converting Cstring to float Pin
Member 166473319-Jan-05 0:28
Member 166473319-Jan-05 0:28 
GeneralRe: Converting Cstring to float Pin
jhwurmbach6-Apr-05 5:40
jhwurmbach6-Apr-05 5:40 
GeneralRe: Converting Cstring to float Pin
vaibhavbvp3-Feb-13 18:20
vaibhavbvp3-Feb-13 18:20 
GeneralOutside the window Pin
Anonymous18-Jan-05 8:37
Anonymous18-Jan-05 8:37 
GeneralRe: Outside the window Pin
User 665818-Jan-05 11:03
User 665818-Jan-05 11:03 
GeneralRe: Outside the window Pin
Garth Watkins18-Jan-05 22:01
Garth Watkins18-Jan-05 22:01 
GeneralCDialog child of a toolbar Pin
Giuliana18-Jan-05 8:27
Giuliana18-Jan-05 8:27 
GeneralUI thread question Pin
Tom Wright18-Jan-05 7:33
Tom Wright18-Jan-05 7:33 
GeneralRe: UI thread question Pin
Serge Krynine18-Jan-05 12:12
Serge Krynine18-Jan-05 12:12 
GeneralRe: UI thread question Pin
Tom Wright19-Jan-05 11:20
Tom Wright19-Jan-05 11:20 
QuestionHow can I affect the result of GetClientRect? Pin
Dimitris Vikeloudas18-Jan-05 7:17
Dimitris Vikeloudas18-Jan-05 7:17 
AnswerRe: How can I affect the result of GetClientRect? Pin
HurricaneFlossie18-Jan-05 8:28
HurricaneFlossie18-Jan-05 8:28 
AnswerRe: How can I affect the result of GetClientRect? Pin
Shog918-Jan-05 11:32
sitebuilderShog918-Jan-05 11:32 
GeneralSubclassing ListBox so as to provide functionality of both single selection and multiple selection list box Pin
Close Network18-Jan-05 6:58
Close Network18-Jan-05 6:58 
GeneralRe: Subclassing ListBox so as to provide functionality of both single selection and multiple selection list box Pin
David Crow18-Jan-05 7:07
David Crow18-Jan-05 7:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.