VC++6.0 UpdateData() 函数

        函数UpdateData实践内容:

         MSDN上的内容:

         

CWnd::UpdateData

BOOL UpdateData( BOOL bSaveAndValidate = TRUE );

Return Value

Nonzero if the operation is successful; otherwise 0. If bSaveAndValidate is TRUE, then a return value of nonzero means that the data is successfully validated.

Parameters

bSaveAndValidate

Flag that indicates whether dialog box is being initialized (FALSE) or data is being retrieved (TRUE).

Remarks

Call 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.)

CWnd OverviewClass MembersHierarchy Chart

See Also   CWnd::DoDataExchange

        /**************************************************************************************************************

        *    函数名称: UpdateData();

        *    返回值    :  操作成功返回一个非零整数,否则返回0;

        *                     如果参数bSaveAndValidate  是TRUE,返回值是非零,表示:“数据生效”;

        *     参数      :  bSaveAndValidate   = FALSE  表示,将控件的值赋值给绑定的变量,

        *                     bSaveAndValidate   = TRUE  表示,将绑定的变量的值在对话框上显示;

        *     描述      :  对话框(dialog)的控件与变量之间的初始化。

        **************************************************************************************************************/

 

 关于“编辑框”与“变量”之间的关联。可以在“类向导”中的“Member Variables” 中设置和查看到。

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值