visual c++ notes: day one
To get/set data from controls:
UpdateData( [ TRUE FALSE ]);
where: TRUE - retrieve data from controls, FALSE - update form data with values in the code editor.
To enable/disable controls:
GetDlgItem(control_id)->EnableWindow([TRUE FALSE]);
To show/hide controls:
GetDlgItem(control_id)->ShowWindow([TRUE FALSE]);
To associate a variable to a control:
Right-click the control, then choose the ClassWizard. Click on the member variables tab, choose the control's control id, then click on the "Add variable" button (it's recommended that you use Hungarian notation to name your variables).
To initialize variables:
Add a function (using the ClassWizard) to the WM_INITDIALOG message. On the code editor, type the initialization values of your variables.
To execute an external program:
WinExec("program name", SW_SHOW);
To exit the application:
OnOK();
UpdateData( [ TRUE FALSE ]);
where: TRUE - retrieve data from controls, FALSE - update form data with values in the code editor.
To enable/disable controls:
GetDlgItem(control_id)->EnableWindow([TRUE FALSE]);
To show/hide controls:
GetDlgItem(control_id)->ShowWindow([TRUE FALSE]);
To associate a variable to a control:
Right-click the control, then choose the ClassWizard. Click on the member variables tab, choose the control's control id, then click on the "Add variable" button (it's recommended that you use Hungarian notation to name your variables).
To initialize variables:
Add a function (using the ClassWizard) to the WM_INITDIALOG message. On the code editor, type the initialization values of your variables.
To execute an external program:
WinExec("program name", SW_SHOW);
To exit the application:
OnOK();
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home