Hi, I was wondering if someone could explain to me why the following code will not compile..
1 2 3 4 5 6 7 8 9 10 11
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
//create a "Hello World" message box using MessageBox()
MessageBox(NULL,
L"Press OK if George is Frickin Awesome!!!!",
L"George",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
I get an error.. but if i remove the L before "Press okay.." & "George" the code compiles just fine.
Because of the UNICODE settings. Most Windows API functions are now hidden behind macros for example MessageBox will call either MessageBoxA or MessageBoxW depending on the UNICODE define along with this you will require L"Whatever" or just "Whatever", to make sure you have the correct one use the text macro:
TEXT("whatever")