如何让窗口过程函数包含在类中?
部分代码
public:
WNDCLASSEXW mf;
LRESULT __stdcall MainProc(HWND,UINT,WPARAM,LPARAM);
---------------------------
this->mf.lpfnWndProc = &MainWindow::MainProc; 报错
this->mf.lpfnWndProc = &this->MainProc; 报错
this->mf.lpfnWndProc = mw + &MainWindow::MainProc;(mw是这个类的一个实例指针)报错
this->mf.lpfnWndProc = mw + &this->MainProc; 报错
如果
static LRESULT __stdcall MainProc(HWND,UINT,WPARAM,LPARAM);
就对了,那么怎么在不加static的基础上完成呢?MFC是如何完成的?
[解决办法]
你搜索Thunk学习一下