刚建立一个据于APPWIZARD对话框的应用程序时,点击运行后生成一个对话框,点击上面的"确定"键对话框消失,但是在dialog.cpp的文件中没有找到ONOK()这个函数,是谁决定了确定按钮的响应呢?哪位大侠出手帮俺解决一下这个问题?

解决方案 »

  1.   

    //CDialog默认的。void CDialog::OnOK()
    {
        if (!UpdateData(TRUE))
        {
            TRACE0("UpdateData failed during dialog termination.\n");
            // the UpdateData routine will set focus to correct item
            return;
        }
        EndDialog(IDOK);
    }
      

  2.   

    好像这个是封装了的,在afxwin.h里面有定义啊
      

  3.   

    理论上将你是使用的生成对话框后系统自带的那个按钮,那个是窗口初始化时默认的,你要用ONOK()这个函数的话要重载的。双击那个按钮试试,会有提示的。
      

  4.   

    楼上的能不能说的详细一点?
    二楼的好像是对的,我先查查看,
    //CDialog默认的。void CDialog::OnOK()
    {
        if (!UpdateData(TRUE))
        {
            TRACE0("UpdateData failed during dialog termination.\n");
            // the UpdateData routine will set focus to correct item
            return;
        }
        EndDialog(IDOK);
    }