Solved

Declaring a Global Collection in a multi-form application

Posted on 2004-04-20
1
144 Views
Last Modified: 2010-04-24
Hi

I used to program in VB, and now I have to use C++ .NET (don't ask why)

1) How/where do i declare a global collection that all my forms can see and communicate with?

2) I figured out that in order for form A to display form B, we create an instance of B in A, and do a B::ShowDialog(this);
the question is, how do I pass information back to A from B, I tried including A.h in B but it doesn't like it

please help
0
Comment
Question by:moseph
1 Comment
 
LVL 48

Accepted Solution

by:
AlexFM earned 125 total points
ID: 10875209
If you keep some collection in form A, you can add pointer to this collection to form B as class member:

public:
    CSOmeCollection* pCollection;

When form A created form B, it sets pCollection to it's own collection object:

pB->pCollection = &collection;
// show B dialog now

B form works with collection using this pointer.


0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now