How do you set a class member function to be a WNDPROC? I am creating my own custom class to represent a window, and I have the following in my constructor:
Code:
WNDCLASSEX CanvasClass;
...
CanvasClass.lpfnWndProc = &TCanvasWindow::WndProc;
However I get an error:
converting from `LRESULT (TCanvasWindow::*)(HWND__ *, unsigned int, unsigned int, long int)' to `LRESULT (*)(HWND__ *, unsigned int, unsigned int, long int)'
I have tried casting the function pointer to WNDPROC (the type of lpfnWndProc) but this doesn't seem to work either.
I am using Dev-C++ and MinGW on Windows XP Professional.
Please help!