Hey guys. I'm trying to learn some windows programming, but i'm getting some errors with the code:
[CODE=cpp]#include <windows.h> // include the basic windows header file
// the entry point for any Windows program
int WINAPI WinMain(HINSTAN CE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
// create a "Hello World" message box using MessageBox()
MessageBox(NULL ,
L"Hello World!",
L"Just another Hello World program!");
MB_ICONEXCLAMAT ION | MB_OK);
// return 0 to Windows
return 0;
}
[/CODE]
The errors I get (using Dev-C++) are
In function `int WinMain(HINSTAN CE__*, HINSTANCE__*, CHAR*, int)':
cannot convert `const wchar_t*' to `const CHAR*' for argument `2' to `int MessageBoxA(HWN D__*, const CHAR*, const CHAR*, UINT)'
Alright, I've been using c++ in DOS (i think) so I need some guidance here.
Thanks in advance.
[CODE=cpp]#include <windows.h> // include the basic windows header file
// the entry point for any Windows program
int WINAPI WinMain(HINSTAN CE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd)
{
// create a "Hello World" message box using MessageBox()
MessageBox(NULL ,
L"Hello World!",
L"Just another Hello World program!");
MB_ICONEXCLAMAT ION | MB_OK);
// return 0 to Windows
return 0;
}
[/CODE]
The errors I get (using Dev-C++) are
In function `int WinMain(HINSTAN CE__*, HINSTANCE__*, CHAR*, int)':
cannot convert `const wchar_t*' to `const CHAR*' for argument `2' to `int MessageBoxA(HWN D__*, const CHAR*, const CHAR*, UINT)'
Alright, I've been using c++ in DOS (i think) so I need some guidance here.
Thanks in advance.
Comment