Solved

Declaring a Global Collection in a multi-form application

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
add a property to an object 6 118
custom build rules files in Visual Studio 2012 1 140
Need help with a query 7 50
mixing C++ & C# in Vis Studio 2013 7 172
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

772 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