分割视图中 有左右两个视,LeftView,RightView 怎样实现在左视图中点一下右键,在右视图中画一个圆 要给出在左视图区 获取右视图指针的代码!!

解决方案 »

  1.   

    天龙 兄:
    你怎么老问些这样的问题?
    嘻嘻
    ----------------
    先获得分隔条的指针/或者分割条
    CMainFrame
    {
    public:
    CSplitterWnd splitter;
    }
    假设你在BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
    {
    splitter.Create......
    }
    中分割!
    #include "MainFrm.h"
    ....
    void CLeftView::OnRButtonDown(UINT nFlags, CPoint point) 
    {
    // TODO: Add your message handler code here and/or call default
    CMainFrame pFrame=(CMainFrame*)AfxGetMainWnd();
    CRightView pView=(CRightView*)pFrame->splitter.GetPane(0,1);
     
    //use the pview to draw circle in the rightview
    ....

    CView::OnRButtonDown(nFlags, point);
    }