Original Post
Hey ppl. I got a unusual compiler problem today, saying that it cant convert the WinProc function to a type. Heres the compiler error:
Extra info:
I tried to use a typecaste "(WinProc)" as i saw in other apps, but this didnt work. Also the winproc function and the setup code is part of a window C++ class.
Any idea how to solve this problem?
-J
[edited by - jason2jason on January 24, 2003 8:02:38 PM]
error C2440: '=' : cannot convert from 'long (__stdcall CWindow::*)(struct HWND__ *,unsigned int,unsigned int,long)' to 'long (__stdcall *)(struct
HWND__ *,unsigned int,unsigned int,long)'
There is no context in which this conversion is possible
Here is there winproc definition and the part where i assign it:
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
//Registering the Window Class
//WndClass.cbSize = sizeof(WNDCLASSEX);
//WndClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
WndClass.lpfnWndProc = WndProc;
//WndClass.cbClsExtra = 0;
//WndClass.cbWndExtra = 0;
//WndClass.hInstance = *hInstance;
//WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
//WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
//WndClass.hbrBackground = NULL;
//WndClass.lpszMenuName = NULL;
//WndClass.lpszClassName = ClassName;
//WndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
//Comments above are to show you the ones i'm not talking about to point out the line that i am.