大家好,我现在正在做的程序需要我在MainFrame中调用Document中的函数,请问有谁能帮我一下,告诉我如何调用?

解决方案 »

  1.   

    先获得恃的指针,再访问它的成员函数
    CYourDocument *pDocu;
    CYourView *pView;
    pView=(CYourView *)GetActiveView();
    pDoc=pView->GetDocument();
    在MainFrm中包含View的头文件
      

  2.   

    先获得恃的指针,再访问它的成员函数
    CYourDocument *pDocu;
    CYourView *pView;
    pView=(CYourView *)GetActiveView();
    pDoc=pView->GetDocument();
    在MainFrm中包含View的头文件
    ----------------------------------------
      

  3.   

    CMyDoc *pDoc;
    pDoc=(CMyDoc *)GetActiveDocument()