Lescha
asked on
MainFrame <=> Doc/View communications
On SDI/MDI applications, the Toolbar(s) belong to CMainFrame. How can I affect their behavior from Doc/View classes? I want to show/hide them on request from menu command.
Of course, I could take menu events in MainFrame class, but it would not be good project design, and besides, the broader question is this: how do I communicate between MainFrame and Doc/View classes?
Of course, I could take menu events in MainFrame class, but it would not be good project design, and besides, the broader question is this: how do I communicate between MainFrame and Doc/View classes?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
GetDocument()->
as you pointer
to acess the mainframe from the view class use
((CMainframe*)AfxGetMainWn
as your pointer
notice that the CFrameWnd pointer typecasted to your CMainFrame class
to acess view from document use
GetActiveView()->
GetNextView()->
etc