Link to home
Start Free TrialLog in
Avatar of Lescha
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?
Avatar of ghimireniraj
ghimireniraj

to acess any doc variable from view class use

GetDocument()->



as you pointer

to acess the mainframe from the view class use
((CMainframe*)AfxGetMainWnd())->

as your pointer

notice that the CFrameWnd pointer typecasted to your CMainFrame   class

to acess view from document use


GetActiveView()->

GetNextView()->

etc













ASKER CERTIFIED SOLUTION
Avatar of RONSLOW
RONSLOW

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial