关于窗口分割问题?谢谢(已解决)
用AppWizard生成单文档CuteFTP,生成的视类为 CCuteFTPView.同时在增加三个视类或者从视类继承而来的派生类CView2,CView3 CView4. 然后在Cmainfrm.h中增加代码:CSplitterWnd m_wndSplitter1; CSplitterWnd m_wndSplitter2;CSplitterWnd m_wndSplitter;重载CMainFrame::OnCreateClient()函数: BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
//创建一个静态分栏窗口,分为三行一列
if(m_wndSplitter1.CreateStatic(this,3,1)==NULL)
return FALSE;
//将CCuteFTPView连接到0行0列窗格上
m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CCuteFTPView),CSize(100,100), pContext);
m_wndSplitter1.CreateView(2,0,RUNTIME_CLASS(CView4),CSize(100,100),pContext);
//将CView4连接到0行2列
if(m_wndSplitter2.CreateStatic(&m_wndSplitter,1,2,WS_CHILD|WS_VISIBLE,
m_wndSplitter.IdFromRowCol(1, 0))==NULL)
return FALSE; //将第1行0列再分开1行2列
//将CView2类连接到第二个分栏对象的0行0列
m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CView2),CSize(400,300),pContext);
//将CView3类连接到第二个分栏对象的0行1列
m_wndSplitter2.CreateView(0,1,RUNTIME_CLASS(CView3),CSize(400,300),pContext);
return TRUE;
// return CFrameWnd::OnCreateClient(lpcs, pContext);
}一运行,该加的头文件都加了,编译通过了,一运行总出现错误:错误图片如附件,请高手帮助,解析下,为什么,谢谢(
[[it] 本帖最后由 sunstudent 于 2008-4-29 18:02 编辑 [/it]]
错误图片.rar
(9.89 KB)