We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Getting access to Doc class from a property page

bhushanvi
bhushanvi asked
on
Medium Priority
222 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.
Comment
Watch Question

IT Professional
Top Expert 2005
Commented:
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




Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
AndyAinscowFreelance programmer / Consultant
CERTIFIED EXPERT
Commented:
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();

Author

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.
AndyAinscowFreelance programmer / Consultant
CERTIFIED EXPERT

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

Author

Commented:
I just want to assign it a B grade! Thankyou for doing the needful.

Author

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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.