Thursday, December 24, 2020

Error C2440: 'static_cast': cannot convert from 'UINT (__thiscall CSizingControlBar::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'

Error C2440: 'static_cast': cannot convert from 'UINT (__thiscall CSizingControlBar::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'

  1. CSizingControlBar - A Resizable Control Bar
  2. My fix is: find all defined af_msg handler definition and update return type to : LRESULT.

    afx_msg LRESULT CSizingControlBar::OnNcHitTest(CPoint point)
    afx_msg LRESULT OnNcHitTest(CPoint point);

  3. Thread: VC2005 not happy with what ON_WM_NCHITTEST() returnsshare-icon
  4. It may depend on which version of VC you are using and which version of MSDN.
    VS2005 MSDN shows the prototype for WM_NCHITTEST to be:
    afx_msg LRESULT OnNcHitTest( CPoint point );

  5. Error C2440: 'static_cast' cannot convert from __thiscall
  6. very close to answer/fix...

  7. ON_WM_NCHITTEST (and other MFC macros) won't compile in whidbey
  8. error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CImportProjectDlg::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
  9. Issue with conversion from Visual C++ 6.0 to Visual Studio 2012
  10. Getting a program from Windows XP to Windows 7, MFC vs C# vs C++
  11. a good reference
  12. error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint) (转)
  13. 解决方法: 找到 UNIT CStaticLink::OnNcHitTest(CPoint point) 将UNIT 改为LRESULT

  14. error C2440: 'static_cast' 错误的解决方法
  15. 问题描述:
    在将vc6.0程序转换到vs2005或者vs2008、vs2010时提示:error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint) 解决方法:
    找到 UNIT CStaticLink::OnNcHitTest(CPoint point) 将UNIT 改为LRESULT

  16. errors pointing to the message map

No comments:

Post a Comment