PDA

View Full Version : Convert int to LPCWSTR c++ win32


richmasta+
09-12-2005, 04:09 AM
I want to show an int value in a messagebox.

How would i convert an int, double or any other number to a LPCWSTR

nikkiH
09-12-2005, 02:41 PM
Can you use the usual itoa (http://www.cplusplus.com/ref/cstdlib/itoa.html)function in C++ for this?

Mhtml
09-12-2005, 04:46 PM
Does it have to be wchar?

Mhtml
09-13-2005, 06:54 AM
Well regardless, you can use the itoa function as mentioned... Or another method is-

int x = 55;
stringstream str;
str << x;
string s = str.str();


I assume itoa would use much the same method anyway.