what's the right way to do this?
-
class CDialogPage1 : public CDialogImpl <CDialogPage1> { enum { IDD = IDD_DLG1 }; ... } class CDialogPage2 : public CDialogImpl <CDialogPage2> { enum { IDD = IDD_DLG2 }; ... } class CSettingDlg : public CDialogImpl <CSettingDlg> { public: enum { IDD = IDD_SEETINGDLG }; .... ??? GetDialog(UINT DIALOG_IDD) { //return m_page1 or m_page2 according to the param } private: CDialogPage1 m_page1; CDialogPage2 m_page2; }
how to write this GetDialog function? or maybe i should change CDialogPage1 & CDialogPage2 , make them inherit from the same class? could anyone give me some hints? -
class CDialogPage1 : public CDialogImpl <CDialogPage1> { enum { IDD = IDD_DLG1 }; ... } class CDialogPage2 : public CDialogImpl <CDialogPage2> { enum { IDD = IDD_DLG2 }; ... } class CSettingDlg : public CDialogImpl <CSettingDlg> { public: enum { IDD = IDD_SEETINGDLG }; .... ??? GetDialog(UINT DIALOG_IDD) { //return m_page1 or m_page2 according to the param } private: CDialogPage1 m_page1; CDialogPage2 m_page2; }
how to write this GetDialog function? or maybe i should change CDialogPage1 & CDialogPage2 , make them inherit from the same class? could anyone give me some hints?Are you trying to build a wizard or use a tab ctrl? In which case you could use CPropertySheetWindow to implement this functionality ... Maybe more details on what exactly it is you're trying to do/implement might better help us (or at least myself) understand how to answer ...
:..::. Douglas H. Troy ::..
Fold with us|Development Blogging|viksoe.dk's site -
Are you trying to build a wizard or use a tab ctrl? In which case you could use CPropertySheetWindow to implement this functionality ... Maybe more details on what exactly it is you're trying to do/implement might better help us (or at least myself) understand how to answer ...
:..::. Douglas H. Troy ::..
Fold with us|Development Blogging|viksoe.dk's site -
Go here: Viksoe[^] he has PLENTY of examples with code that will give you what you want ... should make your life a bit easier.
:..::. Douglas H. Troy ::..
Fold with us|Development Blogging|viksoe.dk's site