I'm having issues now.
My code:
This is just a simple "Hello World" using message boxes.
Code:
#include <Windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nShowCmd)
{
MessageBox(NULL, "Hello!",
"Hello World", MB_OK | MB_ICONINFORMATION);
if (MessageBox(NULL, "I'm learning to use C++ to write native Windows programs. Cool, isn't it?",
"Cool, No?", MB_YESNO | MB_ICONQUESTION) == IDYES)
MessageBox(NULL, "You know it!", "Sweet!", MB_OK);
else MessageBox(NULL, "Jerk.", "Grrr", MB_OK);
return 0;
}
I'm using Microsoft Visual Studio C++ Express Edition 2008 as my IDE.
1. When I create an empty solution and insert this code, everything runs fine on my computer, but when I tried to show it to friends they said they all got an error that my application was not configured properly.
2. When I create an empty Win32 solution and insert the code, it refuses to build, telling me for each argument I pass:
Quote:
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [13]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
|
I've tried using the Windows.h that came with the IDE and one I got from Windows Platform SDK for Windows Server 2003 R2.