I'm having a similar problem to the one that originally stumped me with regards to defining a non-static windows procedure method within a class. This time the problem relates to Subclassing.
I am attempting a similar solution, i.e. when I create the control, I am passing the "this" pointer as the LPARAM, so I can avoid having a purely static procedure for the control.
The problem I am having is that the SetWindowLong API function wants a LONG as the third paramater, but I am unable to cast the method to a long.
i.e. the above is generates a compiler error.Code:OldCtrl = (WNDPROC)SetWindowLong(buttonCtrl, GWL_WNDPROC, (LONG)ButtonProc);
Any ideas?'type cast' : cannot convert from 'LRESULT (__stdcall CApp::* )(HWND,UINT,WPARAM,LPARAM)' to 'LONG'