I created a dialog box (cMyDialog). I plan to duplicate cMyDialog and call it cMyDialog2. How can I inherit in MFC? I want cMyDialog2 to inherit all IDDs from cMyDialog1, so I don't need to copy and paste the code from cMyDialog1 to cMyDialog2. The purpose of cMyDialog2 is to inherit all the functions from cMyDialog1 and add some additional functions to it.
Thank you very much for your response. I'm not quite sure about IMPLEMENT_DYNAMIC. Below is a short snippet of my code. Can you look at it and help me if I misunderstood the macro?
cMyDialog1::cMyDialog1(void * pMsgData, CWnd* pParent ): CDialog(cMyDialog1::IDD, pParent)
{
}
BOOL cMyDialog1::OnInitDialog()
{
CDialog::OnInitDialog();
...
}
cMyDialog2::cMyDialog2(void * pMsgData, CWnd* pParent )
: CMyDialog1(cMyDialog2::IDD, pParent)
{
IMPLEMENT_DYNAMIC(cMyDialog2, cMyDialog1)
}
I can inherit from CMyDialog using DECLARE_DYNAMICand methods IMPLEMENT_DYNAMIC. Thanks so much for your help, Adam.
. CMyDialog1, , " ", . , CMyDialog1 CMyDialog , , ? ?
peace