Re: Dialog class by Andre
Andre
Thu Nov 11 06:24:01 CST 2004
It is possible, but I'm not too sure about using the Class Wizard. I think
the Class Wizard assumes that if you're defining a class based on a CDialog,
then it must be associated with a pre defined dialog resource.
Just create a new .h/.cpp by hand copying from another existing class, then
create your new class definition from that.
-------------------------------------------------------------------------------------------
class CNewDialog : public CDialog
{
CNewDialog(UINT nIDTemplate, CWnd* pParent=NULL);
};
CNewDialog::CNewDialog(UINT nIDTemplate, CWnd* pParent /*=NULL*/)
: CDialog(nIDTemplate, pParent)
{
//{{AFX_DATA_INIT(CBDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
-------------------------------------------------------------------------------------------
Then when you create a new dialog, create it in ClassWizard using CDialog
and change it by hand to use CNewDialog.
Now that I write this out, it seems kinda long winded, but thats what I've
used in my current project....
HTH
Andre
"iLLiDaN" <iLLiDaN@discussions.microsoft.com> wrote in message
news:48B52C2E-E1F6-4185-937A-977AF9ACB066@microsoft.com...
> Hi, I want to do a dialog class based in CDialog class, for using it in a
> Dialog based project. Is it possible? because when I create it, the
> classwizard need a IDD_Dialog but I want to do a dialog class to use it in
> many dialogs...
>
> Can you help me?
>
> Thanks. Regards.