Templated Dialogs

A

Andrew Maclean

Is it possible to use templated dialogs?

I think the problem sits with the IMPLEMENT_DYNAMIC macro. I haven't been
able to do it. Has anyone a solution?

e.g I want to do something like this:

template < typename T >
class CSomeParamsDlg : public CPropertyPage
{
DECLARE_DYNAMIC(CSomeParamsDlg)

public:
CSomeParamsDlg();
virtual ~CSomeParamsDlg();

// Dialog Data
enum { IDD = IDD_SOME_PARAMS };

protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support

DECLARE_MESSAGE_MAP()

public:
T * param;
};

//..................................

IMPLEMENT_DYNAMIC(CSomeParamsDlg , CPropertyPage)
CSomeParamsDlg ::CSomeParamsDlg ()
: CPropertyPage(CSomeParamsDlg ::IDD)
{
pCM = CCommonMemory::Instance();
}


CSomeParamsDlg ::~CSomeParamsDlg ()
{
}

void CSomeParamsDlg ::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CSomeParamsDlg , CPropertyPage)
END_MESSAGE_MAP()

//-------------------------------------------------

Thanks for any help.

Please reply to the newsgroup.



Andrew
 
M

Michael Buechel

how about the keyword novtable and not using IMPLEMENT_DYNAMIC

otherwise you have to implement dynamic your own. have a look at the
macro(s) and copy the code to your class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top