?
Solved

Getting access to Doc class from a property page

Posted on 2006-11-08
8
Medium Priority
?
200 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
[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
  • 3
  • 2
8 Comments
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 225 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 150 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
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 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