我在单文档框架类中,添加了一个菜单的响应函数,但该函数内需调用视图类中的一个函数,我用如下方法
CHotelmisView* p=(CHotelmisView*)((CMainFrame*)AfxGetMainWnd())->GetActiveView();
     p->CreateRoomType();//是一个自定义的函数
所以我在框架类中加入了
#include "hotelmisView.h"//视图类的头
但编译出错三个!!
hotelmisview.h(21) : error C2143: syntax error : missing ';' before '*'
hotelmisview.h(21) : error C2501: 'CHotelmisDoc' : missing storage-class or type specifiers
hotelmisview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
请大家看一下为什么????注hotelmisview.h(21)指CHotelmisDoc* GetDocument();

解决方案 »

  1.   

    加上也一样,好像不是这个问题,,这三个error是什么意思呀?谢谢了
      

  2.   

    CHotelmisDoc* GetDocument()?就是这样的吗?是不是应该是CHotelmisDoc* pDoc = GetDocument()呀?
      

  3.   

    #include "hotelmisDoc.h"
    要加到hotelmisView.cpp中
      

  4.   

    #include "hotelmisDoc.h"
    要加到hotelmisView.cpp中,我试了还是不行呀,真怪了!!!????
      

  5.   

    可以试试在“工程”菜单里的“设置”选项{ALT+F7}里选LINK,然后把所有的.CPP文件选中,然后把“分类”设成PRECOMPILED HEADERS,在下面选“N”那一项不使用预补偿页眉!我在编程的时候遇到“莫名其妙”的问题时就这样,多半可以解决问题,祝你好运!
      

  6.   

    把哪个include加到hotelmisView.h中
      

  7.   

    你说的框架类是指CMainFrame么?可是GetDocument()不是是CView的方法吗?