I am wanting to use RegisterClass for a number of classes which inherit from CFormView. The classes are so similar (ie. they only differ by the dialog ID they use) that I would like to use a templated class and then call RegisterClass(CPageTemplate<IDD_THISDIALOG> for each one. I am having problems with using IMPLEMENT_DYNAMIC in achieving this. The code for the template I am having problems with looks like this.


template<UINT iResource> class CPageTemplate : public CFormView
{
protected:
CPageTemplate<iResource>(){};
DECLARE_DYNCREATE(CPageTemplate)

// Form Data
public:
enum { IDD = iResource };

protected:
virtual ~CPageTemplate<iResource>(){};

};

template<UINT iResource>
IMPLEMENT_DYNAMIC(CPageTemplate<iResource>, CFormView)




Any help would be appreciated.