I'm sorry that this is quite a recycled problem, but most of the help on here hasn't helped. My problem is that I want to be able to display integers in my Win 32 application but obviously they need to be in a certain format to be printed (LPCWSTR I believe). So I tried this:
LPCWSTR intToString(int i){
TCHAR buf[32];
_itow_s(i, buf, 10);
return buf;
}
But it when I printed it using
TextOut(hdcBuffer, 30, 40, intToString(xValue), 32);
It printed lots of random characters to the screen, much like trying to open a file in notepad when it really isn't meant to be opened there. (so with random squares, lines, ampersands etc.) I've tried things like sprintf() and a few other things that I can't remember. Please don't suggest downloading new libraries or anything because I don't want to do that, particularly, unless it is the only way.
Again, sorry for such repetitivity, but the solutions on other pages just don't seem to work. I'm using Visual Studio 2012 on a Windows 7 computer. If you require any more info please say so, I'll co-operate to the best of my ability.
Thank you :)