Click to See Complete Forum and Search --> : Setting Active View


Steve McNeese
April 6th, 1999, 01:42 PM
I have a SDI interface with a 2 pane vertical splitter. The pane on the left is created first and then the pane on the right. Each pane has a CView derrived class. A call to GetActiveView() will return a pointer to the CView of the right pane (the last one created). How can I get a pointer to the left view in pane 0 to pass to SetActiveView(CView *) to make it the active view?

Thanks,

Steven M. McNeese
steven.mcneese@boeing.com

Noodle
April 6th, 1999, 01:54 PM
I think you must have a CSplitterWnd object, why don't you use SetActivePane(0, 0)? it will worked as SetActiveView, and could active left pane(view).

Steve McNeese
April 6th, 1999, 02:10 PM
I was just trying that but I cannot figure out how to get access to my CSplitterWnd member variable. This variable is a member of CMainFrm and I am trying to access it the the main application class. Any ideas?

Steven M. McNeese
steven.mcneese@boeing.com

Noodle
April 6th, 1999, 03:43 PM
I think you can use this any where in your application.
((CMainFrm *)(::AfxGetMainWnd()))->m_splitterWnd.SetActivePane(0, 0)