I wrote this program that has several Edit controls in the main window and numbers printed in them when you start the application. In most Edit controls I print doubles, but in one Edit control I print an integer. I used this piece of code that I found in the 'Programming Windows' book of Charles Petzold to convert one or more numbers in a wide-character string:
and then I use these two lines in the WinProc to print the variable set.timesteps, which is actually 1, in an edit control with handle hwndEdit:
TCHAR* NumberToString(TCHAR* szFormat, ...)
_vsnwprintf_s(szBuffer, sizeof(szBuffer)/sizeof(TCHAR), sizeof(szBuffer)/sizeof(TCHAR), szFormat, pArgList);
szFormat = szBuffer;
This works perfectly fine on several pcs except on one pc of a colleague of mine. There a 'V' is printed in the edit control. This seems like a Unicode problem but I have no clue as to what can be the cause.
tempbuf = NumberToString(TEXT("%d"), set.timesteps);