SDI工程 想创建三个视图 一个是利用向导生成的CTestView,另两个是派生的视图类CView1,CView2
在框架类中声明分割视图类成员变量
CSplitterWnd m_wndSplitter;
重载下面这个函数
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
{
 BOOL ret=m_wndSplitter.CreateStatic(this,3,1);
 ret|=m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CTestView),CSize(100,100),pContext);
 ret|=m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CView1),CSize(100,200),pCon text);
 ret|=m_wndSplitter.CreateView(2,0,RUNTIME_CLASS(CView2),CSize(100,100),pContext);
 return ret;

然后提示 CTestViewCTest : is not a class or namespace name
        'CTestViewCTest ' : undeclared identifier
我在函数的上面加上TestView.h头文件怎么又引起其他的错误??
CTestStaticSplitWndDoc* GetDocument();提示error C2143: syntax error :   missing ';' before '*'
为什么??

解决方案 »

  1.   

    CTestStaticSplitWndDoc* 应为CTestDoc* GetDocument();
      

  2.   

    CTestStaticSplitWndDoc类的头文件呢?
      

  3.   

    在TestView.h文件前面加上#include "TestDoc.h",即可!
    给分吧,肯定行!
      

  4.   

    vcleaner(我没做大哥已经很久了.......) 兄台厉害.不过我想你肯定遇到过.
    一般情况下.CTestDoc* GetDocument();函数的实现文件才有 #includeTestDoc.h"头文件
    还要在声明中加上,问题才解决
    谢谢
    呵呵 全给你了.