I am trying to learn basic Win32 programming and have run into a frustrating problem. I want to convert a variable (name it NumClicks) and display it as an application name (as part of a string). From what I saw, switching from int + some block of text to char * is problematic because converting it to the required final data type (LPCWSTR) is more complicated than straightforward casting.
Any ideas or links?
use wsprintfIt allows you to compose a line in the same way as printf allows you to print a line of text.
_itow _s
, INT LPWSTR (, ), StringCchPrintfW.
, , LPCWSTR:
int f =55; wchar_t buffer[10]; _itow_s (f, buffer, 10); func_using_lpcwstr_as_parameter(buffer);
instead of using wsprintf, I would use sprinf (buf, "% S", "plain old line");