在SDI窗内用Splitter分割了二个窗口,分别是CleftView和CrightView.
CleftView中有个按钮m_btn0,通过PreTranslateMessage(MSG *pMsg)捕捉m_btn0按下.
设置了一个回调函数,编译通过,不过到pItemDlgFun(UINT a)后,飞到CDCD中了.有没有其它不用回调函数的方法啊?
在这先谢谢啦!

解决方案 »

  1.   

    先获取框架的指针:CMainFrame* pFrame=static_cast<CMainFrame*>(AfxGetMainWnd());
    然后获得另一个类的指针:CrightView* listview=static_cast<CrightView*>(pFrame->Splitter.GetPane(0,1));
    然后直接通过指针调用类的成员函数:listview->funtion();
      

  2.   

    取得parent的指针,再GetPane就行了。
      

  3.   

    如果你有用到CDocument,建议你用CDocument的OnUpdateAllViews,这样可以保持各个VIEW之间的松耦合。