Get pointer to CMianFrame in SDI app

I need to get a pointer to the CMainFrame in the app class.
In a MDI app MFC does // create main MDI Frame window
                    pMainFrame = new CMainFrame; I then
save this pointer as a member of the app class. The SDI app doesn't do this. I need to access the main window's status bar in the app class of an SDI app. Can anyone help?
BlackRussianAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
Well, there are several ways to achieve what you want - you could e.g. pass the pointer to the class' constructor and store it, use 'GetActiveDocument()' from the frame window, the 'GetDocument()' method in 'CView()' and lots of other ways...

((CFrameWnd*) (AfxGetApp()->m_pMainWnd))->GetActiveDocument()

0
 
migelCommented:
AfxGetMainWnd()
0
 
migelCommented:
strane answer
0
All Courses

From novice to tech pro — start learning today.