UpdateDate()只有一个参数,默认参数为TRUE。其作用如下:
用于初始化对话框数据和接受合法的对话框数据。(Call this member function to initialize data in a dialog box, or to retrieve and validate dialog data.)
BOOL UpdateData(
BOOL bSaveAndValidate = TRUE
);
The framework automatically calls UpdateData with bSaveAndValidate set to FALSE when a modal dialog box is created in the default implementation of CDialog::OnInitDialog. The call occurs before the dialog box is visible. The default implementation of CDialog::OnOK calls this member function with bSaveAndValidate set to TRUE to retrieve the data, and if successful, will close the dialog box. (If the Cancel button is clicked in the dialog box, the dialog box is closed without the data being retrieved.)