VC learning 3

xiaoxiao2021-03-06  49

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

转载请注明原文地址:https://www.9cbs.com/read-56996.html

New Post(0)