InVC provides the "dialog box-based application" function. You need to select the "dialog box-based application" in the first step of using AppWizard ",.
VC generates code containing the derived classes of the application and dialog box. The following code is displayed in the InitInstance () member function of the application class:
BOOL CMy58_s1App: InitInstance ()
{
CMy58_s1Dlg dlg;
M_pMainWnd = & dlg;
Int nResponse = dlg. DoModal ();
If (nResponse = IDOK)
{
// TODO: Place code here to handle when the dialog is
//Dismissed with OK
}
Else if (nResponse = IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
//Dismissed with Cancel
}
Return FALSE;
}
This is to generate a mode dialog box and create it.FALSE to exit directly. During the design, you can design the interface by editing the dialog box resources, and then process the customer's input through ClassWizard ing message. As the previous sections have already mentioned, this section will not be repeated.
Similarly, dialog box-based applications can also use the attribute dialog box as the field.