Solved

Getting access to Doc class from a property page

Posted on 2006-11-08
8
195 Views
Last Modified: 2013-11-20
Hi,
    I am Launching Wizard type property Sheet/Pages on the execution of FileNew() command on the execution of menu command for File->New; which is handled in CMainFrame class. I want to transfer the data from the controls on the property pages into the storage structs in the document class on the execution of a command button on the property page. I am using an SDI application with multiple views with switching enabled and handled in the CMainFrame class. Thank you.
0
Comment
Question by:bhushanvi
  • 3
  • 2
8 Comments
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 75 total points
ID: 17896406
Do you want to access document class from a Property Sheet/Property Page or Dialog?

You may pass document's pointer in your property sheet class's constructor. ..

-MAHESH




0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 50 total points
ID: 17896583
For an SDI you can use AfxGetMainWnd() which will return a pointer to the main frame (you need to cast it) and then get the active view/doc based from the frame.

CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
0
 

Author Comment

by:bhushanvi
ID: 17900013
I made a mistake in assigning C grade to the accepted solution. Just accept my apology. This is my first time I am grading a solution and hence forth will take care of my grading.
0
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.

 
LVL 44

Expert Comment

by:AndyAinscow
ID: 17900091
I've made a request in community support for the question to be re-opened so you can regrade it.
0
 

Author Comment

by:bhushanvi
ID: 17915931
I just want to assign it a B grade! Thankyou for doing the needful.
0
 

Author Comment

by:bhushanvi
ID: 17922928
Hi! Thanx for updating the grade. Also, Mahesh can you help me out with your approach of passing a doc class ptr in the property sheet constructor? I just have a slight idea that this can be done but don't have any program that illustrates this. Will you please explain me what all additions are to be made to the property sheet constructor, property pages and the doc class( any other class) for that sake? It will be of great help. Thank you.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 129
conditional code and condition difference 9 82
bigDiff challenge 17 106
JQuery serialize and unserialize 8 83
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: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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