Link to home
Start Free TrialLog in
Avatar of ducksoup
ducksoup

asked on

Passing values between dialogs.

I have an SDI application with a formview.  I have popup modeless and modal dialogs. I would like to share variables between these dialogs.

Would you please give me an example of how I can pass variables.

Thank you



Avatar of Gandalf32
Gandalf32

You can either create a global variable, or declare the variable in one class, and pass a pointer to the other class.
ASKER CERTIFIED SOLUTION
Avatar of fstab
fstab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
fstab: Please post as comment, until an answer is accepted. Otherwise, the question is locked, keeping other experts from viewing it.
That's the basic idea - if I think I have the answer I should post it as an answer - other experts can still view it and post a comment .. in case my answer is rejected the person who posted the correct answer as a comment can still get points .. its all in the hands of (in this case) ducksoup ..
Hi,

The best way(and the commonly used method) is to declare those variables in App class and access them anywhere in the application.

If Ur application is Test

then declare the flag(for ex) m_bFlag in CTestApp.h

Then U can access it as

((CTestApp *)AfxGetApp())->m_bFlag

Try it out.