|
|

楼主 |
发表于 2008-2-28 10:19:00
|
显示全部楼层
Re:LPCTSTR = Long Pointer to a Const TCHAR STRing
Error 1 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [13]' to 'LPCWSTR' ...
For some strange reason, I remeber seeing code that prefixed string literals with an" L" character, but I never really knew why this prefix was there. So, I prefixed my strings with the magic "L" character and poof.. the compile error went away.
Can somebody explain what this "L" represents and is there some project setting or #define, #pragma that I can use to avoid having to prefix my string literals with the "L"?
I also tried to prefix my strings with "_T(...)" but I just get the following compile error:
Error 1 error C3861: '_T': identifier not found ...
Does this require a special header file? (At the moment, I only #include <windows.h>).
I'm really new to this windows programming and until today, I never even heard of a LPWSTR or LPCSTR ... etc. but I do know that prefixing a string with a captial letter "L" is not a C/C++ standard unless it defines a macro of some sorts...(When I tried to "go to definition" of "L", I only got "identifier not found" message box).
Thanks in advance for any enlightenment!
Regards,
|
|