Hello :)
The SetDlgItemText() function takes in a LPCTSTR datatype as one of its arguments.
I was just curious how to convert an integer into this datatype.
Thanks in advance!
Printable View
Hello :)
The SetDlgItemText() function takes in a LPCTSTR datatype as one of its arguments.
I was just curious how to convert an integer into this datatype.
Thanks in advance!
You could use SetDlgItemInt()
or
convert to a string or char array.
Code:char szBuf[MAX_PATH]={0};
_snprintf(szBuf, MAX_PATH-1,"%d",iValueToBeDisplayed);
SetDlgItemText(hWnd, ID_EDIT,szBuf);
Or if you're using C++ (which I assume since you cross-posted there),
Code:SetDlgItemText(hWnd, ID_EDIT, boost::lexical_cast<std::string>(your_int).c_str());