Search code examples
cwinapikernelulong

How to convert Ulong to Lptstr in C


I have an ulong value, how can i convert it to LPTSTR? I need to get LPTSTR value. (no printf)

Example code:

ULONG value = 1;
LPTSTR valueString = ???

Thanks!


Solution

  • Use one of the _itoa() family of functions or StringCchPrintf(). The links go to the 'safe' versions of the functions, but the winapi also provides 'unsafe' and leagacy variants.