Solved

Get pointer to CMianFrame in SDI app

Posted on 1999-01-08
3
495 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
repeatSeparator  java  challenge 13 56
Whole sheet autoscrub still needed 19 44
either24  challenge 19 84
twoTwo  challenge 35 87
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video discusses moving either the default database or any database to a new volume.

746 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

11 Experts available now in Live!

Get 1:1 Help Now