15,979
社区成员
发帖
与我相关
我的任务
分享
// View类中定义两个成员
CSplitterWnd m_wndSplitter;
BOOL m_bSplitter = FALSE;
void CXView::OnMenuitem32771() // 菜单项的响应函数
{
// TODO: Add your command handler code here
if(NULL == m_wndSplitter.GetSafeHwnd())
{
CCreateContext cc;
memset(&cc, 0, sizeof(CCreateContext));
CRect rc;
GetClientRect(&rc);
VERIFY(m_wndSplitter.CreateStatic(this, 1, 2, WS_CHILD | WS_VISIBLE));
cc.m_pNewViewClass = RUNTIME_CLASS(CXView);
VERIFY(m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CXView), CSize(300, rc.Height()), &cc));
cc.m_pNewViewClass = RUNTIME_CLASS(CXView);
VERIFY(m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CXView), CSize(0, rc.Height()), &cc));
m_wndSplitter.MoveWindow(0, 0, rc.Width(), rc.Height());
m_wndSplitter.RecalcLayout();
m_bSplitter = TRUE;
}
}
void CXView::OnDraw(CDC* pDC) // 将OnDraw中的两句代码给注释掉
{
// CXDoc* pDoc = GetDocument();
// ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}