jiangsheng:
你好!
谢谢你上次对我的帮助,我简要描述一下我的做法,你看看有什么毛病:
我建了一个SDI工程,最后一步用的是一个CFormView作为基类,然后我又扩展了两个类CFormView和CTreeView,并且把这两个类,作为切分窗口(splitter window)的view来动态创建,创建的函数如下:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
// create a splitter with 1 row, 2 columns
if (!m_wndSplitter.CreateStatic(this, 1, 2))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
// add the first splitter pane - the default view in column 0
if (!m_wndSplitter.CreateView(0, 0,
RUNTIME_CLASS(CMyTreeView), CSize(130, 50), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}
// add the second splitter pane - an input view in column 1
if (!m_wndSplitter.CreateView(0, 1,
RUNTIME_CLASS(CMyFormView), CSize(0, 0), pContext))
{
TRACE0("Failed to create second pane\n");
return FALSE;
}
// activate the input view
SetActiveView((CView*)m_wndSplitter.GetPane(0,1));