1>c:\expbarsample\scbarg.cpp(57): error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CSizingControlBarG::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
1> Cast from base to derived requires dynamic_cast or static_cast
出现这样的错误,可以单击这个错误, 它会指向这个文件(本例中是scbarg.cpp)中一个函数(本例中是 ON_WM_NCHITTEST())
然后 Ctrl + F 查找这个函数 查找到:UINT CSizingControlBarG::OnNcHitTest(CPoint point) 换成 LRESULT CSizingControlBarG::OnNcHitTest(CPoint point)
同时要到这个 scbarg.h 文件中去 把声明这个OnNcHitTest函数的类型修改成 LRESULT 通过Ctrl + F 定位到 afx_msg UINT OnNcHitTest(CPoint point);
并修改成afx_msg LRESULT OnNcHitTest(CPoint point); 就可以了。