Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Getting access to Doc class from a property page

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
bhushanvi
Asked:
bhushanvi
  • 3
  • 2
2 Solutions
 
mahesh1402Commented:
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
 
AndyAinscowCommented:
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
 
bhushanviAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
AndyAinscowCommented:
I've made a request in community support for the question to be re-opened so you can regrade it.
0
 
bhushanviAuthor Commented:
I just want to assign it a B grade! Thankyou for doing the needful.
0
 
bhushanviAuthor Commented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now