我在单文档框架类中,添加了一个菜单的响应函数,但该函数内需调用视图类中的一个函数,我用如下方法
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();
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();
要加到hotelmisView.cpp中
要加到hotelmisView.cpp中,我试了还是不行呀,真怪了!!!????