[win 32 C开发者_开发知识库++]
I don't know how to convert float to LPCWSTR/LPWSTR or LPCWSTR <-> LPWSTR
Thanks a lot
#include <sstream>
...
float f = 45.56;
wstringstream wss;
wss << f;
// wss.str().c_str() returns LPCWSTR
cout << wss.str() << endl;
...
The native Win32 API doesn't have any functions for printing floating point values, but there's a more recent addition called strsafe which has StringCchPrintf
TCHAR buffer[24];
StringCchPrintf(buffer, sizeof(buffer)/sizeof(TCHAR), "%f", float_value);
精彩评论