编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛  
 
全能 ASP / PHP / ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付学习型 ASP/PHP/ASP.NET 主机 30元/年
发新话题
打印

MFC中函数作用

MFC中函数作用

我刚用MFC 看到好多地方在一段程序后面加了UpdateData(FALSE/true) 这是干什么用的啊?那位告诉下 谢谢?

TOP

没见过,能把那些代码发上来一些,我看看吗?
当头晕的时候我终于明白了什么叫爱情。

TOP

这个是用来往绑定数据的控件上传值的,具体的msdn你应该看看ddv,ddx相关的详细内容。
UpdateData(true)的意思是把绑定在控件上变量的值传到窗体上显示出来。UpdateData(false)的意思是把控件上的值传到绑定到控件的变量上。
写最好的程序。

TOP

谢谢楼上的,明白意思了

TOP

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里的东东啊

当头晕的时候我终于明白了什么叫爱情。

TOP

是的,就是这东东,

TOP

谢谢了

TOP

发新话题