- . , , . , Visual C++.
■ 䳿, 䳿 .
■ .
■ ³ Visual Studio. 䳿:
1. ³ Resource View ( View), . 1.8.
2. Dialog (ij ) IDD_HELLODIALOG_ DIALOG. (resource ID), . IDD_HELLODIALOG_DIALOG, .
3. Visual Studio ( Dialog Editor), ( Toolbox) , , . Resource View , .
. 1.11, Cancel, , , .
. 1.11. , , Visual Studio no
4. 䳿. ( ) ' , . 䳿 (event handler).
䳿. , Click () . - , . 䳿, , ?
Event Handler Wizard ( ), , (right-click) (double-click). Event Handler Wizard , , ', Add Event Wizard ( ).
, ', Add Event Wizard.
5. Message type ( ) BN_CLICKED , Class () CHelloDialogDlg. Event Wizard , ' , . , -, .
|
|
6. Add and Edit ( ). ³ , CHelloDialogDlg::OnBnClickedOk ( , ' ). , :
void CHelloDialogDlg::OnBnClickedOk()
{
AfxMessageBox("You clicked the Ok button");
// ONOK();
}
, , , ( CDialog::EndDialog). , .
7. , :
<F5>, . : " ?" Yes (), Visual Studio, ( ), ;
: Build () Build Solution ( ), <F5>.
8. . ϳ ' , . 1.12.
. 1.12. 䳿