Don't use
SetWindowTextW
, since the rest of your code is MBCS/Unicode switchable. Use the base
SetWindowText
(without the
W) and let the compiler generate the correct version. So your code should be:
CString str;
Int res = 2;
Str.Format(_T("%d"), res);
m_conrol.SetWindowText(str);
Note also the use of the
_T()
macro, you should use it for
all string constants.