Click here to Skip to main content
14,021,965 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I created a dialog window in MFC VC++. in that, I inserted a button to open another dialog window. I want to perform some tasks in the second dialog based on the variables involved in first dialog class. So how can I get access of that in the second dialag class.

What I have tried:

I couldn't achieve even though I tried the following ways.
1)I declared all the parameters as public which I require
2)I inherited that first dialog class along with CDialog class into the second dialog class, but there were build errors.
Please help me. It will be very useful for my project.
Posted
Comments
Richard MacCutchan 18-Feb-19 8:15am
   
Create a method in the parent which can return the data that the child needs. Alternatively, add the required data to the constructor of the child dialog. Either of those is better than exposing your variables.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.190417.4 | Last Updated 18 Feb 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100