ON_WM_NCHITTEST 问题解决方法


VS2010中,ON_WM_NCHITTEST宏编译不过,报错信息如下:


error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CMenuBar::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)' Cast from base to derived requires dynamic_cast or static_cast

 

为了修改这个bug,我们把

afx_msg UINT OnNcHitTest(CPoint point);


改成

afx_msg LRESULT OnNcHitTest(CPoint point);

另外,VC6 和 VS2003 转换到VS2010 时可能会遇到的问题以及解决方法:

http://blog.sina.com.cn/s/blog_4add390001000ac0.html

原文地址:https://www.cnblogs.com/lingshaohu/p/2279904.html