Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

errors pointing to the message map

69 views
Skip to first unread message

Jack

unread,
May 17, 2008, 8:51:43 AM5/17/08
to
1>c:\documents and settings\luckie.mechtrans\projects\sizecbar.cpp(55) :
error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall
CSizingControlBar::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
1> Cast from base to derived requires dynamic_cast or static_cast

BEGIN_MESSAGE_MAP(CSizingControlBar, baseCSizingControlBar)
//{{AFX_MSG_MAP(CSizingControlBar)
ON_WM_CREATE()
ON_WM_PAINT()
ON_WM_NCPAINT()
ON_WM_NCCALCSIZE()
ON_WM_WINDOWPOSCHANGING()
ON_WM_CAPTURECHANGED()
ON_WM_SETTINGCHANGE()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
ON_WM_NCLBUTTONDOWN()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONDBLCLK()
ON_WM_RBUTTONDOWN()
ON_WM_NCMOUSEMOVE()
ON_WM_NCHITTEST() <<<<<< C2440
ON_WM_CLOSE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_SETTEXT, OnSetText)
END_MESSAGE_MAP()

how do I fix this? Thanks
Jack


Scott McPhillips [MVP]

unread,
May 17, 2008, 9:13:09 AM5/17/08
to
"Jack" <j...@knight.com> wrote in message
news:e7WnAzBu...@TK2MSFTNGP03.phx.gbl...

Your message handler function has the wrong prototype. It should return
LRESULT instead of UINT. They used to be equivalent, but with 64-bit source
compatibility and improved compiler checking of the prototypes your old code
has a roadblock to progress. If you're not familiar with the message map
stuff you might want to just delete the function and message map line, then
add them again using the wizard.

--
Scott McPhillips [VC++ MVP]

Jack

unread,
May 18, 2008, 12:19:56 AM5/18/08
to
Thanks Scott.
Jack


0 new messages