拆分窗口问题-- error C2653: “CtestView”: 不是类或命名空间名称

核心代码:

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
  // TODO: 在此添加专用代码和/或调用基类
 CRect rect;
 GetClientRect(&rect);//获得窗口客户区坐标
 CSize paneSize(rect.Width(),rect.Height());

 m_splitter.CreateStatic(this,3,1,WS_CHILD | WS_VISIBLE);
 m_splitter.CreateView(0,0,RUNTIME_CLASS(CtestView),paneSize,pContext);
 m_splitter.CreateView(1,0,RUNTIME_CLASS(CtestView),paneSize,pContext);
 m_splitter.CreateView(2,0,RUNTIME_CLASS(CtestView),paneSize,pContext);

 


 //return CFrameWnd::OnCreateClient(lpcs, pContext);
 return true;
}

 

当我们运行时会出现

1>c:\users\lenovo\desktop\aa\test\test\mainfrm.cpp(235) : error C2653: “CtestView”: 不是类或命名空间名称
1>c:\users\lenovo\desktop\aa\test\test\mainfrm.cpp(236) : error C2653: “CtestView”: 不是类或命名空间名称
1>c:\users\lenovo\desktop\aa\test\test\mainfrm.cpp(237) : error C2653: “CtestView”: 不是类或命名空间名称

 

这个只要我们添加

#include "testDoc.h"
#include "testView.h"

注意我的工程名为test

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值