Possible Duplicate:
Why does my simple C++ GUI application show a message box in Chinese?
I have implemented this block of code as below in Visual C++:
int nResult=MessageBox(NULL,
(LPCWSTR)"An example of Cancel,Retry,Continue",
(LPCWSTR)"Message Box!",
MB_ICONWARNING|MB_ABORTRETRYIGNORE);
however, no matter what i tried, it always show a message box in chinese! Therefore, i just want to ask for any solution for my problem and why there is chinese message here. Thanks you!
You forgot to place ‘L’ before the string literal. Modify as follows:
In C++ unicode string literals are prefixed with
L. If you don’t put the prefix, casting to ‘unicode string constant’ won’t help and causes incorrect interpreting of the memory location.