Solved

Getting access to Doc class from a property page

Posted on 2006-11-08
8
193 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

19 Experts available now in Live!

Get 1:1 Help Now