CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    121

    Question VS2005: explicit specialization error

    I am getting error with below code while compiling with VS2005:

    Code:
    BEGIN_MESSAGE_MAP(CTreeDataCtrl<CLogicTreeData>, CTreeCtrl)
    	//{{AFX_MSG_MAP(CTreeDataCtrl)
    		// NOTE - the ClassWizard will add and remove mapping macros here.
    	//}}AFX_MSG_MAP
    END_MESSAGE_MAP()
    Error is as below:
    error C2906: 'const AFX_MSGMAP *CTreeDataCtrl<T>::GetThisMessageMap(void)' : explicit specialization requires 'template <>'

    I tried doing as below, but the error was not resolved:
    Code:
     BEGIN_MESSAGE_MAP(template<>CTreeDataCtrl<CLogicTreeData>, CTreeCtrl)
    Note that the definition as in code is
    Code:
    template <class T>
    class CTreeDataCtrl : public CTreeCtrl
    {
    .
    .
    }
    
    class CTreeCtrl : public CWnd
    {
    .
    .
    }
    Can anyone please shed some light on this?
    Note that I am getting error at below line:
    Code:
    BEGIN_MESSAGE_MAP(CTreeDataCtrl<CLogicTreeData>, CTreeCtrl)
    There are 10 types of people in this world, those who understand binary and those who do not!!

  2. #2
    Join Date
    Dec 2008
    Posts
    144

    Re: VS2005: explicit specialization error

    Check this: http://msdn.microsoft.com/en-us/libr...16(VS.80).aspx
    I'm not sure if this feature is avalaible in VS2005.

  3. #3
    Join Date
    Nov 2005
    Posts
    121

    Re: VS2005: explicit specialization error

    Many Thanks. I changed it as below and and it compiled rightly.
    Code:
    BEGIN_TEMPLATE_MESSAGE_MAP (CTreeDataCtrl, CLogicTreeData, CTreeCtrl)
    There are 10 types of people in this world, those who understand binary and those who do not!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured