Oh as for the whole (LPCWSTR) casting thing: It wouldn’t compile unless I put those in. It gave me this error message:
Error 1 error C2664: ‘MessageBoxW’ : cannot convert parameter 2 from ‘const char [22]’ to ‘LPCWSTR’
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Put an L infront of your string to make it a wide string. L”Goodbye cruel World”
Then you won’t need the cast.
You can also use the TEXT(“”) macro that will create an unicode string or ascii string depending on your configuration settings.
The reason you were seeing chinese is that MessageBox was interpreting an ascii string as unicode.