CChildView类从CWnd类继承。
在SDI工程中,想要实现窗口分割,1行2列。CChildView在第二列。BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
m_CreatedOK = m_Splitter.CreateStatic(this, 1, 2);
if(m_CreatedOK){
m_CreatedOK = m_Splitter.CreateView(0, 0, RUNTIME_CLASS( CTest2 ),CSize(0, 0), pContext);
m_CreatedOK = m_Splitter.CreateView(0, 1, RUNTIME_CLASS( CChildView ),CSize(0, 0), pContext); //此处报错
}
return m_CreatedOK ==0 ? false : true;
}提示
F:\工作\编程测试\easymaprelease\easymap\复件 (2) GisShow\MainFrm.cpp(154) : error C2039: 'classCChildView' : is not a member of 'CChildView'
f:\工作\编程测试\easymaprelease\easymap\复件 (2) gisshow\childview.h(33) : see declaration of 'CChildView'
F:\工作\编程测试\easymaprelease\easymap\复件 (2) GisShow\MainFrm.cpp(154) : error C2065: 'classCChildView' : undeclared identifier
在SDI工程中,想要实现窗口分割,1行2列。CChildView在第二列。BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
m_CreatedOK = m_Splitter.CreateStatic(this, 1, 2);
if(m_CreatedOK){
m_CreatedOK = m_Splitter.CreateView(0, 0, RUNTIME_CLASS( CTest2 ),CSize(0, 0), pContext);
m_CreatedOK = m_Splitter.CreateView(0, 1, RUNTIME_CLASS( CChildView ),CSize(0, 0), pContext); //此处报错
}
return m_CreatedOK ==0 ? false : true;
}提示
F:\工作\编程测试\easymaprelease\easymap\复件 (2) GisShow\MainFrm.cpp(154) : error C2039: 'classCChildView' : is not a member of 'CChildView'
f:\工作\编程测试\easymaprelease\easymap\复件 (2) gisshow\childview.h(33) : see declaration of 'CChildView'
F:\工作\编程测试\easymaprelease\easymap\复件 (2) GisShow\MainFrm.cpp(154) : error C2065: 'classCChildView' : undeclared identifier
ChildView.h 文件类定义里面加上
class ChildView: public CView
{
DECLARE_DYNCREATE(CChildView )...
};cpp里面
#include "ChildView.h "IMPLEMENT_DYNCREATE(CChildView , CView/*这个是基类*/)CChildView ::CChildView ()
....
不知道你是不是view类派生来的?