I was going to start with Win32 app development. Before I could get the first window to display i was ready to give up! I was overwhelmed by the number of datatypes you need to know about before you can write a simple WinMain and WndProc. (unless you copy-paste of course!)
Especially these –
LPSTR
LPCSTR
LPWSTR
LPCWSTR
Can someone point me to the right article that explains these with respect to Win32 programming? Which ones should I know about, which ones are needed in what situation, when to go for Unicode, what is multi-byte char set, and all the related stuff.
And the conversion to/from these datatypes to char* and char[] and whatnot, when calling Win32 API functions is a pain.
It is all so confusing.
Thanks for the help.
The pattern is relatively simple:
LPSTR = zero-terminated string of
charLPCSTR = constant zero-terminated string of
char(C == constant)LPWSTR = zero-terminated string of
wchar_t(W == wide character)LPCWSTR = constant zero-terminated string of
wchar_t(C and W)For details and explanations see e.g. http://www.codeproject.com/KB/string/cppstringguide1.aspx
The linked article also contains advice when to use Unicode in your application and when not.