Solved

Get pointer to CMianFrame in SDI app

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tripleUp challenge 7 79
Sed question 2 86
unix example issues 18 90
Bartender label printing - switch on and off graphics 3 39
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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

777 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