我就在CMainFrame添加这么一点代码如下:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
{
// TODO: Add your specialized code here and/or call the base class CRect rect;
GetWindowRect(&rect);
CSize rectSize;
rectSize=rect.Size();
m_MySplitter.CreateStatic(this,1,2);
m_MySplitter.CreateView(0,0, 
RUNTIME_CLASS(CTestView), CSize(500,500), pContext); 
m_MySplitter.CreateView(0,1, RUNTIME_CLASS(CTestView), CSize(500,500), pContext); 
SetActiveView((CTestView*)m_MySplitter.GetPane(0,0)); 
return 1;
}
可是为什么运行起来会报如下的错误呢,我的工程是保存在:
--------------------Configuration: test - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
test.cpp
MainFrm.cpp
e:\myprojects\test\testview.h(21) : error C2143: syntax error : missing ';' before '*'
e:\myprojects\test\testview.h(21) : error C2501: 'CTestDoc' : missing storage-class or type specifiers
e:\myprojects\test\testview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
testDoc.cpp
testView.cpp
Generating Code...
Error executing cl.exe.test.exe - 3 error(s), 0 warning(s)
请高手分析下这是怎么回事。是不是分割窗口的时候哪里还需要写代码的啊?