jerry820726 发表于 2006-7-19 15:08

MFC中函数作用

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

十一月天 发表于 2006-7-19 15:36

[em09]没见过,能把那些代码发上来一些,我看看吗?

NET爱好者 发表于 2006-7-19 20:50

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

jerry820726 发表于 2006-7-20 10:55

谢谢楼上的,明白意思了[em17]

十一月天 发表于 2006-7-21 10:22

<P>Call this member function to initialize data in a dialog box, or to retrieve and validate dialog data.</P>
<P>BOOL UpdateData(<BR>   BOOL bSaveAndValidate = TRUE <BR>);<BR>Parameters<BR>bSaveAndValidate <BR>Flag that indicates whether dialog box is being initialized (FALSE) or data is being retrieved (TRUE). <BR>Return Value<BR>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.</P>
<P>Remarks<BR>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.)<BR><BR>找到英文的解释了,楼主说的是MFC里的东东啊[em09]</P>

jerry820726 发表于 2006-7-21 12:45

<P>是的,就是这东东,[em01]</P>

jerry820726 发表于 2006-7-21 12:46

谢谢了[em01]

页: [1]

编程论坛