First, the classification mode and the mode of dialog
Second, create
mode:
Cminedlg DLG;
Dlg.domodal ();
No mode:
Cminedlg * pdlg = new cminedlg;
PDLG-> CREATE (DLGID, NULL);
Third, delete
Mode: Automatic ONOK / INCANCEL, call the base class enddialog ()
No mode: CWnd :: postncdestroy () {delete this;}
Overload onok / oncancel, destroywindow ()
Fourth, create a control used class wizard or dynamically created
Dynamically created:
In addition to the header file, the pointer member cbutton * pbutton;
Message mapping function in the source file:
CMYDLG :: OnInitDialog ()
{pbutton = new cbutton;
Pbutton-> Create ("CAPTION", WS_CHILD | WS_Visible | BS_Pushbutton, CRECT (0, 0, 100, 40), THIS, 202);} // CAPTION, STYLE, POSTION, PARENTWINDOW, ID Download