我这样写:((CTestMDIApp *)AfxGetApp())->ShowView();可是不管我怎么加上"TestMDIApp.h "都找不到
CTestMDIApp文件!
简单问题谢谢回复!!

解决方案 »

  1.   

    你看下那个xxApp.h 有一个它的对象的。好像写在最后面extern xxApp 这个就可以使用了啊
      

  2.   


    void CDlg1Dlg::OnButton1() 
    {
    // TODO: Add your control notification handler code here
    CDlg1App* app = (CDlg1App*)AfxGetApp();
    app->ShowMsg();
    }void CDlg1App::ShowMsg()
    {
    MessageBox(NULL, "", "", MB_OK);
    }
      

  3.   


    谢谢回复,我是这样写的可是他说找不到:CTestMDIApp 这个类,包含文件又没有??
      

  4.   

    看你的问题
    在要用到CTestMDIApp的.cpp中,加上
    extern CTestMDIApp theApp;以后就用theApp吧。