Original Post
This is my Window procedure which keeps giving me an Error 2: 1400 message box AKA it cannot create the MainWnd.. anyone got any ideas as to what might be causing it?
void cApp::CreateMainWindow(int ShowCode)
{
const char ClassName[] = "MyGame";
WNDCLASSEX WndCX =
{ sizeof(WNDCLASSEX),CS_CLASSDC, (WNDPROC)MessagePump,0,0,hInstance,NULL,NULL,(HBRUSH)(COLOR_BACKGROUND),NULL, "MyGame",NULL};
if (!RegisterClassEx(&WndCX))
{
char error[256];
sprintf(error, "Error1 %u", GetLastError());
MessageBox(NULL, error, "Error!",MB_ICONEXCLAMATION | MB_OK);
TerminateProgram();
}
MainWnd=CreateWindow("MyGame", "Velochy", WS_POPUP | WS_EX_TOPMOST, CW_USEDEFAULT, CW_USEDEFAULT, 300, 200, NULL, NULL, hInstance, NULL );
if (MainWnd==NULL)
{
char error[256];
sprintf(error, "Error2 %u", GetLastError());
MessageBox(NULL, error, "Error!",MB_ICONEXCLAMATION | MB_OK);
TerminateProgram();
}
ShowWindow(MainWnd, ShowCode);
UpdateWindow(MainWnd);
return;
}