The function _wtol converts from a wide character string to a long. The problem is that it doesn't convert with decimals. I don'开发者_如何转开发t know enough c++ to come up with a workaround, so can someone suggest a workaround or an alternate conversion function that does convert with the decimal?
Thx
void button_click(void) {
Edit_LimitText(edithwnd, 100); // edithwnd is a global hwnd
wchar_t editxt[100];
GetWindowText(edithwnd, editxt, 100); // say I typed 36.56 in the edit control
long lng = _wtol(editxt); // when I pause during debug and look at my locals, lng would equal 36, but I need it to equal 36.56
}
_wtof(), et al. See here.
精彩评论