title: Is DECLARE_DYNAMIC required on abstract base classes in MFC?
body: <p>I have a base class that is derived from an MFC CView class and a templated class, something like;</p>
  
  <pre><code>template&lt;class TYPE&gt;
  class CMytViewT : public CView,public CMyTemplateClassT&lt;TYPE&gt;
  {
  DECLARE_DYNCREATE(CMyViewT&lt;TYPE&gt;)
  
  private:
     CMyViewT();
  '
  '
  '
  }
  
  
  IMPLEMENT_DYNCREATE(CMyViewT&lt;TYPE&gt;, CView)
  </code></pre>
  
  <p>Now I'm guessing the MFC macros are going to get upset by the templates, and am considering removing the dynamic creation macros for this class, and re-introducing it for each specialization of the template.  For example</p>
  
  <pre><code>template&lt;class TYPE&gt;
  class CMytViewT : public CView,public CMyTemplateClassT&lt;TYPE&gt;
  {
  public:
     CMyViewT();
  '
  '
  '
  }
  
  Class CMyView : public CMyViewT&lt;CMyClass&gt;
  {
  DECLARE_DYNCREATE(CMyView)
  
  private:
     CMyView();
  }   
  
  IMPLEMENT_DYNCREATE(CMyView, CView)
  </code></pre>
  
  <p>I'm wondering is this going to cause problems going forward, as any other implementations I've seen have the macros included for all intermediate classes.  I can't see that it should, but have I missed something?</p>
  
  <p><strong>Edit</strong>  After looking at Matthew Holders answer below, I found the following <a href="https://connect.microsoft.com/VisualStudio/feedback/details/161025/implement-dynamic-t-mfc-macro-for-c-templates-does-not-compile" rel="nofollow">microsoft connect article</a>, which states that support for IMPLEMENT_DYNAMIC_T has been removed due to being buggy.</p>