Try changing the code as follows:
#include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MessageBox(NULL, L"Goodbye, cruel world!", L"Note", MB_OK); return 0; }
If this works because you are missing the header indicating the correct API, you seem to be calling MessageBoxW (version of Unicode) using the ANSI string. If this is not just a test, but you are starting to write a real-world program, think about what type of framework you want to use (usually this is the flag of the precompiler). Then use the _T( macro _T( so that your literals are compatible as with unicode / ansi.
Edit comment @Benoit: Starting a new project with VS 2008/10 sets the default Unicode character set.
Felice pollano
source share