以下代码不行呀
CMyPrint dlg;
dlg.SetWindowText("本年考试查询");
dlg.DoModal();

解决方案 »

  1.   

    不会吧!那你用::SetWindowText(dlg.GetSafeHwnd(),("本年考试查询"));
    试试。
      

  2.   

    CDlg1::OnButton1()
    {
          CDlg2 dlg;
          dlg.m_str = "本年考试查询";
          dlg.DoModal();
    }//Dlg2.h
    public:
         CString m_str;
    //Dlg2.cpp
    CDlg2::OnInitDialog()
    {
        SetWindowText(m_str);
    }
      

  3.   

    AfxGetApp()->GetMainWnd()->SetWindowText("本年考试查询");
      

  4.   

    更改弹出对话框的标题就是在你弹出来的对话框的初始化里面进行
    SetWindowText("本年考试查询");就可以了。
    你的错误是因为你是模式对话框,你的那种调用是错误的。