A: 

My strong guess is that your source file has the wrong encoding. Can you check whether it's saved in some Unicode flavour, most likely UTF-16?

Pekka
Sure...How do I do that?
Bob Dylan
I don't know what IDE you are on, but you should have a "character set" option in your "save as..." dialog, or somewhere in your menus.
Pekka
+13  A: 

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.

FigBug
Yup. Unlike the rest of the world, which does Unicode via UTF-8 encoding, so that plain ol' ASCII characters just work, Microsoft decided to do the whole WCHAR UTF-16 thing. It makes the code pretty non-portable and locks it into the Microsoft world, which is of course what they want. (There are ways around that, but they aren't obvious to the novice programmer.)
Bob Murphy
UTF-8 did not exist when NT was created (That is the excuse they are using anyway) You can probably find a post about it @ http://blogs.msdn.com/michkap/
Anders
+5  A: 

You already have your answer, but this is a good example of why you should use avoid casts. Yes, a cast will get your code to compile, but unless you understand what is going on, most likely you've just created a bug.

In general, my 3 rules of casting are:

  1. Don't cast (fix the code).
  2. Don't cast (adjust your types to stop needing the cast)
  3. Okay, cast, but revisit your decision tomorrow and see if you can do #1 or #2.
R Samuel Klatchko