Solved

Declaring a Global Collection in a multi-form application

Posted on 2004-04-20
1
156 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

27 Experts available now in Live!

Get 1:1 Help Now