updatedata有什么用处?

解决方案 »

  1.   

    Call this member function to initialize data in a dialog box, or to retrieve and validate dialog data. 
    BOOL UpdateData(
       BOOL bSaveAndValidate = TRUE 
    );
     
    实现变量与对话框中控件的信息映射(双向)
    TRUE //dialog box->data 
    False//data ->dialog box
      

  2.   

    查msdn,主要是将控件和数据关联CWnd::UpdateData
    BOOL UpdateData( BOOL bSaveAndValidate = TRUE );Return ValueNonzero if the operation is successful; otherwise 0. If bSaveAndValidate is TRUE, then a return value of nonzero means that the data is successfully validated.ParametersbSaveAndValidateFlag that indicates whether dialog box is being initialized (FALSE) or data is being retrieved (TRUE).ResCall this member function to initialize data in a dialog box, or to retrieve and validate dialog data.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.)
      

  3.   

    updatedata:
    你调用这个函数的时候,就会调用到DataExchange这个函数,以此来实现控件和继承类之间的数据交换.
      

  4.   

    如果增加了一个ID_TEXT1的对象变量是Value的变量UpdateData让ID_TEXT1和Value之间保持同步
      

  5.   

    如果增加的是对象控件control而不是value,就不用使用UpdateData了?