Archived

This topic is now archived and is closed to further replies.

trysil

Once again... (WIN32)

Recommended Posts

trysil    122
For some reason SetWindowLong returns with a error : "the parameter is incorrect" according to GetLastError() The code snippet:
  
		case WM_CREATE:			// window creation

		{
			HINSTANCE hInst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);
			glWindow = (teGLWindow*)(((LPCREATESTRUCT)lParam)->lpCreateParams);
		-->	SetWindowLong(hWnd, GWL_USERDATA, (LONG)glWindow);
			glWindow->hWnd = hWnd;
			return glWindow->createGLWindow();
		}
  
this is from the WinProc function. Why?

Share this post


Link to post
Share on other sites
JonStelly    127
Assuming you''re using the same code from before, you need to be sure to set cbWndExtra in your WNDCLASS structure to some valid value other than 0.

Share this post


Link to post
Share on other sites
trysil    122
I tried a few values, but the question is what value it should have?
I'm a bit of a newbie with WIN32

The example I based this on didn't set the cbWndExtra. It was 0.



Edited by - trysil on February 7, 2002 3:19:38 PM

Share this post


Link to post
Share on other sites