Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Declaring a Global Collection in a multi-form application

Posted on 2004-04-20
1
Medium Priority
?
191 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
[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
1 Comment
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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 will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

604 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