You may have other problems, but one thing should be your help super . This is a Java thing, not C ++. Instead of super you need to use CDialog .
After viewing IMPLEMENT_DYNAMIC , the macro definition is incompatible with templates; it does not use the template <class T> syntax before function definitions. What you need to do is determine the specialized specializations of your template, and then use the macro on them. So you can do this:
class MyDlgA : public CMyDlg<A> { }; IMPLEMENT_DYNAMIC(MyDlgA, CDialog);
And then do it for all specialization desires. If this is not possible, look at the macro and make your own templatized version.
Edit: Following my comment, you can make a macro like this:
#define INSTANTIATE_DLG_TEMPLATE(T) \ class MyDlg##T : public CMyDlg<T> \ { \ }; \ \ IMPLEMENT_DYNAMIC(MyDlg##T, CDialog);
And then just use it wherever you usually defined the specialization of the template in the header file using typedef.
source share