我按照网上帖出来的代码(我在好多帖子中都看到这样的代码)
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
if(wndSplitter1.CreateStatic(this,3,1)==NULL)
return FALSE;
wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CCutFTPView),CSize(100,100),
pContext);
wndSplitter1.CreateView(2,0,RUNTIME_CLASS(CView4),CSize(100,100),pContext);
if(wndSplitter2.CreateStatic
(&wndSplitter1,1,2,WS_CHILD|WS_VISIBLE,wndSplitter1.IdFromRowCol(1, 0))
==NULL)
return FALSE;
wndSplitter2.CreateView(0,1,RUNTIME_CLASS(CView3),CSize(400,300),pContext); wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CView2),CSize(400,300),pContext);
return CFrameWnd::OnCreateClient(lpcs, pContext);
}其中:
CSplitterWnd wndSplitter1;
CSplitterWnd wndSplitter2;
CView2,3,4从CView继承。
CCutFTPView是系统自动创建的视图类。运行后报错:
error C2653: 'CCutFTPView' : is not a class or namespace name
error C2065: 'classCCutFTPView' : undeclared identifier我在MainFrame.cpp中添加 #include "CutFTPView.h"
就会报错:
error C2143: syntax error : missing ';' before '*'
rror C2501: 'CCutFTPDoc' : missing storage-class or type specifiers
error C2501: 'GetDocument' : missing storage-class or type specifiers请问是什么原因?如何解决?我想,好多论坛里都帖出这样的代码,应该就是没有问题的了,可是我却遇到了问题。希望各位高手帮小弟解决。谢谢了。
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
if(wndSplitter1.CreateStatic(this,3,1)==NULL)
return FALSE;
wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CCutFTPView),CSize(100,100),
pContext);
wndSplitter1.CreateView(2,0,RUNTIME_CLASS(CView4),CSize(100,100),pContext);
if(wndSplitter2.CreateStatic
(&wndSplitter1,1,2,WS_CHILD|WS_VISIBLE,wndSplitter1.IdFromRowCol(1, 0))
==NULL)
return FALSE;
wndSplitter2.CreateView(0,1,RUNTIME_CLASS(CView3),CSize(400,300),pContext); wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CView2),CSize(400,300),pContext);
return CFrameWnd::OnCreateClient(lpcs, pContext);
}其中:
CSplitterWnd wndSplitter1;
CSplitterWnd wndSplitter2;
CView2,3,4从CView继承。
CCutFTPView是系统自动创建的视图类。运行后报错:
error C2653: 'CCutFTPView' : is not a class or namespace name
error C2065: 'classCCutFTPView' : undeclared identifier我在MainFrame.cpp中添加 #include "CutFTPView.h"
就会报错:
error C2143: syntax error : missing ';' before '*'
rror C2501: 'CCutFTPDoc' : missing storage-class or type specifiers
error C2501: 'GetDocument' : missing storage-class or type specifiers请问是什么原因?如何解决?我想,好多论坛里都帖出这样的代码,应该就是没有问题的了,可是我却遇到了问题。希望各位高手帮小弟解决。谢谢了。
解决方案 »
- 无法调用CMFCToolBar的保护函数//怎么调用呢???
- 求一个规范全面的 傅里叶快速变换 FFT C++类
- 求windows下带GUI的c++调试器
- 怎样才能onlbuttonup之后让鼠标的位置不能动?我前四次生成的帖子怎么老是出错啊?这次是最新的,希望不要出错,谢谢大家
- 封箱拆箱问题
- 新手求救!怎不能包含CLib.h呢?
- 绝对挑战:父进程是黑盒子,如何显示子gui进程!!!
- 请问如何得到一个char型数据的后几位数?100分相送!
- 遇到一个COM的问题,有没人能解答?
- ActiveX控件??
- 如何读取某一目录下的子目录数,并由相应目录名动态生成菜单,并控制相应菜单?
- 在CListCtrl中.如何取消选中
里加个
class CCutFTPDoc;
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CView2::classCView2" (?classCView2@CView2@@2UCRuntimeClass@@B)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CView3::classCView3" (?classCView3@CView3@@2UCRuntimeClass@@B)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CView4::classCView4" (?classCView4@CView4@@2UCRuntimeClass@@B)
Debug/CutFTP.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.