在VC中,建一单文本应用程序,将窗口分割为两部分,一部分是基于CTreeView类的视图,另一部分是基于CListView类的视图,如何在主框架CMainFrame的菜单响应事件中获取这两个视图的句柄?

解决方案 »

  1.   

    这个对你有用,自己修改下就是你想要的了 获取分割视图中各个视图的指针  CSplitterWnd m_wndSplitter; 
     m_wndSplitter.CreateStatic(this, 1, 2);//分割成一行两列 
     m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftPaneView), CSize(10, 10), pContext); 
     m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightPaneFrame), CSize(0, 0), pContext); 
     //获取左边视图的两种方法 
     CLeftPaneView* pLeftPaneView = (CLeftPaneView*)   m_wndSplitter.GetPane(0,0); 
     //上一句可以用下句代替: 
     //CLeftPaneView* pLeftPaneView  = (CLeftPaneView *)GetActiveView(); 
     //获取右边视图 
     pLeftPaneView->m_pRightPaneFrame = (CRightPaneFrame*) m_wndSplitter.GetPane(0,1);