How to change a member variable in another dialog?

In one dialog, I hope to change a member variable(it's type is CStringArray) in another dialog.(The two dialogs exist at the same time)
How to implement this?
Zhu051200Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
abancroftConnect With a Mentor Commented:
Are these non-modal in the same application? If so, you could do this:

class CDialog1 : public CDialog
{
  // Missing stuff...

public
  CStringArray m_Str;
};

class CDialog2 : public CDialog
{
  // Missing stuff...

public
  CDialog1 *m_pDlg1;
};

CDialog1 dlg1;
CDialog2 dlg2;

dlg2.m_pDlg1 = &dlg1;

dlg1.Create();
dlg2.Create();

Now dlg2 has access to dlg1.m_Str through it's m_pDlg1 member. Obviously, it'd be a good idea to encapsulate the public members.
0
 
gonuguntaCommented:
what do you want to change - value or type
0
 
Zhu051200Author Commented:
thanks for your help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.