Solved

Get pointer to CMianFrame in SDI app

Posted on 1999-01-08
3
499 Views
Last Modified: 2013-11-20
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?
0
Comment
Question by:BlackRussian
  • 2
3 Comments
 
LVL 12

Expert Comment

by:migel
ID: 1327394
AfxGetMainWnd()
0
 
LVL 86

Accepted Solution

by:
jkr earned 100 total points
ID: 1327395
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
 
LVL 12

Expert Comment

by:migel
ID: 1327396
strane answer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 111
How to know only "File created" with EventLog 3 32
How to determine file rename from EventLog ? 2 41
canBalance challenge 34 69
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now