刚学VC++ 照着书建好一段程序,用到了updatedata(FALSE)函数,编译时提示updatedata未定义,问updatedata()函数是在哪个命令库里的?另MSDN哪里有下载?

解决方案 »

  1.   

    兄弟,是不是写函数时忘了大小写啊,UpdateData();应该是CDialog里面的。
      

  2.   

    1.楼上的兄弟说得对.
    2.http://bingle.pku.edu.cn/scripts/submit.exe?ToMatch=MSDN&TypeID=305
      

  3.   

    BOOL CWnd::UpdateData(BOOL bSaveAndValidate = TRUE )
      

  4.   

    是用在控件对映射变量传数据时候用。
    是不是你名字错了UpdateData(TRUE);
      

  5.   

    一定要注意大小写啊,VC和VB可不一样,呵呵,我也是菜鸟。
      

  6.   

    我也有过这样的经历。记得我刚开始学VC的时候,书上有很多错误。先是打印成了UpdataData,又有的书上打成Updatedata.搞得我晕头转向。现在的书真是的,只知道赚钱,连清华出的书都这样了。还是多到CSDN上来问问吧。我觉得好处多多。大家都有这个过程,都会帮忙的。
      

  7.   

    CWnd::UpdateData
    BOOL UpdateData( BOOL bSaveAndValidate = TRUE );返回值:如果操作成功返回非零值;否则为 0. 如果 bSaveAndValidate 是 TRUE, 这个非零值就是有效的.参数:bSaveAndValidate是一个简要说明对话框是已经初始化(FALSE)或数据已重新返回(TRUE)的标记.注意:调用这个函数来初始化对话框中的数据或者是重新返回并验证对话框数据.在调用CDialog::OnInitDialog来缺省创建模式对话框时,框架自动调用bSaveAndValidate=FALSE 的UpdateData函数。这个调用发生在对话框可见前。缺省执行CDialog::OnOK 时会调用令bSaveAndValidate=TRUE 的这个函数去返回数据,如果成功则关闭对话框(如果是按下的CANCEL button,则不会返回数据。)
    以上是我翻译的中的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.)
      

  8.   

    说起这火都来,我初学时用的哪本书,里面的例子老是忘了介绍写上UpdateData语句(不懂得菜鸟菜),调试老得不到结果使我信心大减,走了不少弯路