有没有办法将WndProc包装为私有成员?
如果我有这个:
class Window
{
public:
Window();
virtual ~Window();
void create();
private:
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
};
在我的create()中:
WNDCLASSEX wc;
wc.lpfnWndProc = (WNDPROC) &Window::WndProc;
我收到此警告:
警告:从“ LRESULT(Window :: *)(HWND,UINT,WPARAM,LPARAM){aka long int(Window :: *)(HWND __ *,unsigned int,unsigned int,long int)}转换为“ WNDPROC { aka long int(__attribute __((__ stdcall__))*)(HWND __ *,unsigned int,unsigned int,long int)}'[-Wpmf-conversions]
而且我的窗口HWND为NULL,GetLastError()也返回0.
如何解决?