Reputation: 20360
I get this error when compiling the following source from here:
Error 1 error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)' e:\development\tooltips\cqa0311\statlink.cpp 28
The line of code is for the ON_WM_NCHITTEST below
BEGIN_MESSAGE_MAP(CStaticLink, CStatic)
ON_WM_NCHITTEST()
ON_WM_CTLCOLOR_REFLECT()
ON_WM_LBUTTONUP()
ON_WM_SETCURSOR()
END_MESSAGE_MAP()
I am not sure what MFC voodoo I have to do to get this to compile. Am I out of luck? I guess this was built with some different version of MFC? I am using VS2008.
(I want to have tooltips for my menu items as described on that webpage.)
Upvotes: 3
Views: 3295
Reputation: 99695
From here:
Thanks for the report. I investigated and found that this change was by design, in MFC for Visual Studio 2005. This introduced a source incompatibility, so you will need to update your OnNcHitTest method to return an LRESULT instead of a UINT.
Pat Brenner
Visual C++ Libraries Development
Now OnNcHitTest should be declared as follows:
afx_msg LRESULT OnNcHitTest(
CPoint point
);
Upvotes: 5