MFC Message Map Problems
I have inherited an application written in VS6 (VC) and I am attempting
to upgrade it to VS2005.
I have solved most of the issues - mainly relating to superseded
function calls etc, but there are a couple of issues that I am
struggling with:
I have the following code:
static const AFX_MSGMAP_ENTRY* GetMessageEntries()
{
static const AFX_MSGMAP_ENTRY Entries[] =
{
ON_WM_MEASUREITEM()
ON_WM_MENUCHAR()
ON_WM_INITMENUPOPUP()
ON_WM_ENTERMENULOOP()
ON_WM_EXITMENULOOP()
ON_WM_TIMER()
ON_WM_CREATE()
ON_WM_NCHITTEST()
ON_WM_DESTROY()
ON_WM_SYSCOLORCHANGE()
#ifdef USE_NEW_DOCK_BAR
ON_WM_NCPAINT()
ON_WM_PAINT()
ON_WM_ACTIVATEAPP()
ON_WM_ACTIVATE()
#endif //USE_NEW_DOCK_BAR
{0, 0, 0, 0, AfxSig_end, (AFX_PMSG)0 }
};
return Entries;
}
This generates the error "error C2653: 'ThisClass' : is not a class or
namespace name" on lines 5 - 10
Looking at the definitions (declared in afxmsg.h) they are declared as
follows:
#define ON_WM_MEASUREITEM() \
{ WM_MEASUREITEM, 0, 0, 0, AfxSig_vOWNER, \
(AFX_PMSG)(AFX_PMSGW) \
(static_cast< void (AFX_MSG_CALL CWnd::*)(int, LPMEASUREITEMSTRUCT) >
( &ThisClass :: OnMeasureItem)) },
Now I know what the error means, but this is defined in one of the
standard header files, so what do I need to do?
Thankyou.
Paul