Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get pointer to CMianFrame in SDI app

Posted on 1999-01-08
3
Medium Priority
?
524 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Expert Comment

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

Accepted Solution

by:
jkr earned 400 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
In this post we will learn different types of Android Layout and some basics of an Android App.
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

704 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