Template and message map
-
In my application, I'm using template controls to change the font and colors of any of my MFC controls. As I need some messages, I have a message map like that. BEGIN_TEMPLATE_MESSAGE_MAP(class BASE_TYPE, CColorCtrl, BASE_TYPE) //BEGIN_MESSAGE_MAP(class BASE_TYPE, CColorCtrl, BASE_TYPE) //{{AFX_MSG_MAP(CColorCtrl) ON_WM_CTLCOLOR_REFLECT() ON_WM_CTLCOLOR() ON_WM_DESTROY() ON_WM_TIMER() ON_WM_CREATE() //}}AFX_MSG_MAP END_TEMPLATE_MESSAGE_MAP() The BEGIN_TEMPLATE_MESSAGE_MAP macro is defined here. #define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplArgs, theClass, baseClass) \ template \ const AFX_MSGMAP* PASCAL theClass::_GetBaseMessageMap() \ { return &baseClass::messageMap; } \ template \ const AFX_MSGMAP* theClass::GetMessageMap() const \ { return &theClass::messageMap; } \ template \ AFX_COMDAT AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \ { &theClass::_GetBaseMessageMap, &theClass::_messageEntries[0] }; \ template \ AFX_COMDAT const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \ { \ My pb is I get an error message saying that "_GetBaseMessageMap" is not a member of CColorCtrl. The code was working with Visual Studio 6.0, but does no longer work with Visual Studio .Net How can I port it to .Net?
-
In my application, I'm using template controls to change the font and colors of any of my MFC controls. As I need some messages, I have a message map like that. BEGIN_TEMPLATE_MESSAGE_MAP(class BASE_TYPE, CColorCtrl, BASE_TYPE) //BEGIN_MESSAGE_MAP(class BASE_TYPE, CColorCtrl, BASE_TYPE) //{{AFX_MSG_MAP(CColorCtrl) ON_WM_CTLCOLOR_REFLECT() ON_WM_CTLCOLOR() ON_WM_DESTROY() ON_WM_TIMER() ON_WM_CREATE() //}}AFX_MSG_MAP END_TEMPLATE_MESSAGE_MAP() The BEGIN_TEMPLATE_MESSAGE_MAP macro is defined here. #define BEGIN_TEMPLATE_MESSAGE_MAP(theTemplArgs, theClass, baseClass) \ template \ const AFX_MSGMAP* PASCAL theClass::_GetBaseMessageMap() \ { return &baseClass::messageMap; } \ template \ const AFX_MSGMAP* theClass::GetMessageMap() const \ { return &theClass::messageMap; } \ template \ AFX_COMDAT AFX_DATADEF const AFX_MSGMAP theClass::messageMap = \ { &theClass::_GetBaseMessageMap, &theClass::_messageEntries[0] }; \ template \ AFX_COMDAT const AFX_MSGMAP_ENTRY theClass::_messageEntries[] = \ { \ My pb is I get an error message saying that "_GetBaseMessageMap" is not a member of CColorCtrl. The code was working with Visual Studio 6.0, but does no longer work with Visual Studio .Net How can I port it to .Net?
Hi, did you solve the problem with _GetBaseMessageMap in VC7? I ran into the same.