我用向导生成了一个单文档程序,又生成了一个基类是CWnd的类,我现在希望在这个新生成的类中得到CxxxView的指针,应当如何做?
请大家指教!
谢谢!
请大家指教!
谢谢!
解决方案 »
- 这段直接画桌面窗口的代码为什么不能处理鼠标消息呢?
- 怎么在线程之间传递消息?
- 求助:vs2005manifest文件的问题
- 初步上路,以后应该怎么办?迷惑中?
- 怎样用通过odbc用ado连接accescc数据库
- 问一个小问题,在DLL中作一个WINAPI类型的导出函数,该函数中要调用Dialog,执行过程中出现非法操作,何故?
- 请问各位高手
- 各位牛人,在下有礼了~~~
- 在win7下 如何让mfc对话框程序的标题栏居中显示
- 在Propertysheet中给按钮"ok"加消息映射函数怎么加?
- 求分析和提取网页脚本信息的正统算法
- 我想用msxml4编写读取xml文件获取其中的内容,请问应该依次调用哪些接口?
CXXXView* pView = (CXXXView*)GetNextView(PosOfView);
POSITION PosOfView = GetFirstViewPosition();
CaaaView* pView = (CaaaView*)GetNextView(PosOfView);特别是前三个错误用很多方法多报d:\documents and settings\telecom\桌面\aaa\aaaview.h(16) : error C2143: syntax error : missing ';' before '*'
d:\documents and settings\telecom\桌面\aaa\aaaview.h(16) : error C2501: 'CaaaView::CaaaDoc' : missing storage-class or type specifiers
d:\documents and settings\telecom\桌面\aaa\aaaview.h(16) : error C2501: 'CaaaView::GetDocument' : missing storage-class or type specifiers
d:\documents and settings\telecom\桌面\aaa\aaaview.h(16) : warning C4183: 'GetDocument': missing return type; assumed to be a member function returning 'int'
d:\documents and settings\telecom\桌面\aaa\bbb.cpp(23) : error C3861: 'GetFirstViewPosition': identifier not found, even with argument-dependent lookup
d:\documents and settings\telecom\桌面\aaa\bbb.cpp(24) : error C3861: 'GetNextView': identifier not found, even with argument-dependent lookup
extern class CXXXView* pView;
2.在APP类的.cpp文件的头部对全局变量pView初始化.
CXXXView *pView=NULL;
3.在CXXXView.cpp的构造函数里得到全局变量的实际值
pView=this;这种方法乍一看好象有些复杂,但通过把它定义为全局变量,以后在程序的任何需要视图类指针的地方直接pView->就行了
AfxGetMainWnd()->GetActiveDocument()
(CaaaView*)(((CMainFrame*)AfxGetMainWnd())->GetActiveDocument())->GetNextView(pos);
我用上面两句想得到CaaaView类的指针,可是编译时总是报
d:\documents and settings\telecom\桌面\aaa\aaaview.h(16) : error C2143: syntax error : missing ';' before '*'
d:\documents and settings\telecom\桌面\aaa\aaaview.h(16) : error C2501: 'CaaaView::CaaaDoc' : missing storage-class or type specifiers
d:\documents and settings\telecom\桌面\aaa\aaaview.h(16) : error C2501: 'CaaaView::GetDocument' : missing storage-class or type specifiers
d:\documents and settings\telecom\桌面\aaa\aaaview.h(16) : warning C4183: 'GetDocument': missing return type; assumed to be a member function returning 'int'
这几个错误把(CaaaView*)和#include "aaaView.h"去掉就没有错误了我看来就是不能把我得到的View指针转换成我需要的CaaaView指针,请问大家该怎么办?