CSizingControlBar Error C2440: “static_cast”: 无法从“UINT ,__thiscall CSizingControlBarG::*

发现CsizingControlBar是一个很好的实现VC界面的类,下来编译出现如下错误:

错误 1 error C2440: “static_cast”: 无法从“UINT (__thiscall CSizingControlBarG::* )(CPoint)”转换为“LRESULT (__thiscall CWnd::* )(CPoint)” e:\tempstudy\mfcopengl\mfcopengl\scbarg.cpp 57

解决:查看CWnd类

afx_msg LRESULT OnNcHitTest(CPoint point);

而在CSizingControlBar中是 afx_msg UINT OnNcHitTest(CPoint point);

只要将这些UINT 替换为 LRESULT 就OK

原因:因为原作者的代码是VC6的,我用的是VC2005, 可能是版本不同导致的