Solved

Declaring a Global Collection in a multi-form application

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
help with SQL 15 128
How can I find out what's required to run this program ? 3 83
using dll from another object 1 97
Need help with a query 7 55
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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