| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1925 人关注过本帖
标题:MFC中函数作用
只看楼主 加入收藏
jerry820726
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-3-17
收藏
 问题点数:0 回复次数:6 
MFC中函数作用
我刚用MFC 看到好多地方在一段程序后面加了UpdateData(FALSE/true) 这是干什么用的啊?那位告诉下 谢谢?
搜索更多相关主题的帖子: MFC 函数 FALSE UpdateData 
2006-07-19 15:08
十一月天
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:10
帖 子:3030
专家分:0
注 册:2006-4-19
收藏
得分:0 
没见过,能把那些代码发上来一些,我看看吗?

当头晕的时候我终于明白了什么叫爱情。
2006-07-19 15:36
NET爱好者
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2006-6-6
收藏
得分:0 
这个是用来往绑定数据的控件上传值的,具体的msdn你应该看看ddv,ddx相关的详细内容。
UpdateData(true)的意思是把绑定在控件上变量的值传到窗体上显示出来。UpdateData(false)的意思是把控件上的值传到绑定到控件的变量上。

写最好的程序。
2006-07-19 20:50
jerry820726
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-3-17
收藏
得分:0 
谢谢楼上的,明白意思了

2006-07-20 10:55
十一月天
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:10
帖 子:3030
专家分:0
注 册:2006-4-19
收藏
得分:0 

Call this member function to initialize data in a dialog box, or to retrieve and validate dialog data.

BOOL UpdateData(
BOOL bSaveAndValidate = TRUE
);
Parameters
bSaveAndValidate
Flag that indicates whether dialog box is being initialized (FALSE) or data is being retrieved (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.

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

找到英文的解释了,楼主说的是MFC里的东东啊


当头晕的时候我终于明白了什么叫爱情。
2006-07-21 10:22
jerry820726
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-3-17
收藏
得分:0 

是的,就是这东东,


2006-07-21 12:45
jerry820726
Rank: 1
等 级:新手上路
帖 子:67
专家分:0
注 册:2006-3-17
收藏
得分:0 
谢谢了

2006-07-21 12:46
快速回复:MFC中函数作用
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012052 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved