Click to See Complete Forum and Search --> : MFC and Templates


DFarrell
June 3rd, 1999, 08:53 AM
Is there a way to create a CWnd derived class that is also a template class? I have a project where all of my CWnd classes are derived from a common base class that contains standard functionality. However, it would be more useful if I could create the CWnd derived class using template <CBaseDerivedClass> so the base class functionality could be customized for each window. Any ideas on if this is possible with MFC's CWnd class?

ALM
June 3rd, 1999, 09:27 AM
I'm not sure what you want to accomplish. But it should be possible to do this:

template <class T>
class CWndTemplate : public CWnd
{
...
};