Hi!

I compile this simple "Hello world" Win32 program:

#include<windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(NULL, "Hello World!", "Note", MB_OK);
return 0;
}

When the program runs I get weird fonts. See attachement.

Kindly advise.

Thanks

The more recent Microsoft compilers default to UNICODE encoding for characters. I'm surprised this compiled without any warnings.

Try something like MessageBox(NULL, _TEXT("Hello World!"), _TEXT("Note"), MB_OK);

Or turn off UNICODE Project --> Properties -->Configuration Properties, then the value of Character Set property to Not Set

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.