Re: CreateWindow failing?
What is WindowProcedure? Is this window procedure a member of your class? You can't use a function pointer to a member of your class for use as a window procedure.
Re: CreateWindow failing?
Well...as usual...what does 'GetLastError()' return? For further information take a look at the following FAQ...
Re: CreateWindow failing?
Have you declared the function "WindowProcedure" as follow ?
LRESULT CALLBACK WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
{
switch(uiMsg)
...
...
return DefWindowProc(...);
}
If yes, try this 2 way:
CreateWindow("GameAppClass", WindowTitle.c_str(), WS_POPUP | WS_VISIBLE,
100, 100, 300, 300, NULL, NULL, GlobalInstance, (void*)this);
or
CreateWindow("GameAppClass", WindowTitle.c_str(), WS_POPUP | WS_VISIBLE,
100, 100, 300, 300, NULL, NULL, GetModuleHandle(NULL), NULL;
I don't kwno how your complete class is, maybe these can cause an error...
EDIT:
I have forgotten:
are you creating a fullscreen window or a window-mode one ? If window-mode, you must specify WS_CLIPCHILDREN | WS_CLIPSIBLINGS flags besides WS_POPUP | WS_VISIBLE...
If you're creating a fullscreen window, the probrem can rise becouse you choose a resolution that your hardware/system doesn't supports
Also I recommend you to use CreateWindowEx(....) in the future...
:)
Re: CreateWindow failing?
Ooops.... I didn't put this at the end of my Window Proc:
return DefWindowProc(hwnd, msg, wparam, lparam);
*slaps himself*