Becoming a real nag, aren''t I?
I have done some debugging of my WIN32 code and narrowed down my problem (Can''t create a
rendering context) to these lines:
As the constructor of my class is called I down the line call the CreateWindowEx operation wich
creates an event caught by the winproc function registered with my WNDCLASS.
hWnd = CreateWindowEx(NULL, "OpenGL", name, dwStyle | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
0, 0, width, height, NULL, NULL, (HINSTANCE)GetModuleHandle(NULL),(void*)this);
In my winproc I to begin with creatig an instance of my window class and since the WM_CREATE event has
been cast I begin with:
case WM_CREATE:
{
HINSTANCE hInst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);
glWindow = (teGLWindow*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
SetWindowLong(hWnd, GWL_USERDATA, (LONG)glWindow);
glWindow->hWnd = hWnd;
return glWindow->createGLWindow();
}
It goes wrong in the SetWindowLong call.
I suspect that I for some reason get the "wrong" indata to the winproc.
I''ve done a walkthrough of the code, compared it to a working implementation and the only difference is the
fact that the winproc is declared a friend to the window class. the window class is a superclass inherited
by the engine class that holds the main message loop.
"A witty and slightly sarcastic quote from an unkown source"
-- The generic SIG
/trysil
"A witty and slightly sarcastic quote from an unkown source"-- The generic SIG/trysil