I have a dialog with an edit box written in C (à la Petzold). What I read from the edit box with GetDlgItemText function I convert to a double with an expression like:
kk = strtod(szText,&rpt);
Then I want to pass the variable kk to a MessageBox,
so I use
wsprintf(szBuffer,TEXT("Your value is : %lf"
, kk);
to format a little the variable and
MessageBox(hwnd,szBuffer,"",MB_OK);
I cannot print the result. The MessageBox displays
Your value is: f
Please can anyone tell me why, what’s wrong?
If kk is an integer, everything is OK, and the messagebox works fine. But when kk is a float or double it doesn’t work.
Thanks in advance
kk = strtod(szText,&rpt);
Then I want to pass the variable kk to a MessageBox,
so I use
wsprintf(szBuffer,TEXT("Your value is : %lf"
to format a little the variable and
MessageBox(hwnd,szBuffer,"",MB_OK);
I cannot print the result. The MessageBox displays
Your value is: f
Please can anyone tell me why, what’s wrong?
If kk is an integer, everything is OK, and the messagebox works fine. But when kk is a float or double it doesn’t work.
Thanks in advance