kclemans
asked on
share variables between CView and CDialog?
how do i share a variable that is declared in the dialog class, with my cview class. I need to do this because the variable is a member variable for a group of radio buttons in my dialog class. Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, it worked. Enjoy the points.
In CVIEW.CPP:
int ExampleVariable; // place at the top of the file under preprocessor definitions/#includes etc.
In DIALOG.CPP:
extern int ExampleVariable;// place at the top of the file under preprocessor definitions/#includes etc.
.
void DIALOGCLASS::SomeFunction ()
{
ExampleVariable = m_nMemberVariable; // m_nMemberVariable is a member variable of the DIALOGCLASS
}