?
Solved

How to change a member variable in another dialog?

Posted on 2000-05-16
3
Medium Priority
?
211 Views
Last Modified: 2010-04-02
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?
0
Comment
Question by:Zhu051200
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:gonugunta
ID: 2813471
what do you want to change - value or type
0
 
LVL 4

Accepted Solution

by:
abancroft earned 150 total points
ID: 2814647
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
 

Author Comment

by:Zhu051200
ID: 2819759
thanks for your help!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question