Hi there,
When passing parameters to WIN32 API functions, what's the difference between LPWSTR and LPCTSTR? Should I be converting my buffer to unicode before passing as LPWSTR? If so, what will this conversion look like?
Regards,
George
Yes, LPWSTR is a pointer to a unicode string. You may not have to convert your string, most API functions have an ANSI equivalent (typically the type will then be LPSTR). And there is an API function to convert strings between ANSI and Unicode, but i can't remember what it is called.
Deep down, the difference between some of those many "pointer to string" types is nothing - it all comes down to typecasting ultimately for code safety - you could just as easily pass a void* and the API function will still work on it if the compiler let you compile it that way.
Thank you!
I'll use MultiByteToWideChar to make the conversion.