Original Post
OK, this is my second attempt at this !
I have declaread a global function pointer to my windows message loop. Ihave done this so that I can pass this as a parameter to my windows Objects as they are created.
I am getting errors when I try to compile (MSVC 6)
The declaration is as below;
Then in my applications main loop I have
lptrWindProc = (&WndProc);
Is there a better way of passing the WndProc to a windows class as I make it, and why if I am declared as above do I get the following errors ?
e:\CODING_PROJECTS\Win32_OGLBase\Win32_OGLBase.cpp(35) : error C2059: syntax error : ''(''
119) : error C2065: ''lptrWindProc'' : undeclared identifier
e:\CODING_PROJECTS\Win32_OGLBase\Win32_OGLBase.cpp(119) : error C2440: ''='' : cannot convert from ''long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'' to ''int''
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
I have tried putting the CALLBACK in brackets but that doesn''t help. Can anyone shed some light onto this, I am going mad slowly trying to resolve what should be a simple problem !
Thanks,
Bp.
, when I want a new window I am
LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window UINT uMsg, // Message For This Window WPARAM wParam, // Additional Message Information LPARAM lParam); // Additional Message Information LRESULT CALLBACK (lptrWindProc*) (HWND,UINT,WPARAM,LPARAM); //Function Pointer to the windows Message Lopp