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 :oDataExchange(CDataExchange* pDX)
{
CPropertyPage:oDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CSomeParamsDlg , CPropertyPage)
END_MESSAGE_MAP()
//-------------------------------------------------
Thanks for any help.
Please reply to the newsgroup.
Andrew
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 :oDataExchange(CDataExchange* pDX)
{
CPropertyPage:oDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CSomeParamsDlg , CPropertyPage)
END_MESSAGE_MAP()
//-------------------------------------------------
Thanks for any help.
Please reply to the newsgroup.
Andrew