classes and collection problem 
Author Message
 classes and collection problem

I'm still blowing up in VB 5/6, here's the problem

Using the class builder I have a class AAA

AAA has properties

Name
Bday
Relatives - a collection

Class BBB

BBB has properties

Something
SomethingElse
collection of AAA

Using the class builder I copied AAA into BBB; I haven't tried to define any
extra code

If I have objects AnAAAObject, ABBBObject declared
dim AnObject as New AAA
dim ABBBObject as New BBB

and I fill in AnAAAObject, I should be able to say

ABBBObject.AAA.Add AnAAAObject

I can't!

What am I doing wrong?

Andy



Tue, 29 May 2001 03:00:00 GMT  
 classes and collection problem
<cut>
Quote:
>ABBBObject.AAA.Add AnAAAObject

<cut>

try:
ABBBObject.<exposed collection name>.Add AnAAAObject

example:
in BBB class:
Public thecollection as collection

from elsewhere:
ABBBObject.thecollection.Add AnAAAObject

or maybe:
in BBB Class:
Private thecollection as collection
Public Sub AddObject(newitem as object)
thecollection.Add newitem
End Sub

from elsewhere:
ABBBObject.AddObject anAAAObject



Tue, 29 May 2001 03:00:00 GMT  
 classes and collection problem
Bob - and everybody else

I've enclosed a zip file which shows the problem

When you compile it, the problem becomes evident.

Three cheers to whoever fixes my problem first!!!

Thanks.

Andrew



Tue, 29 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Collection of Collections of Classes

2. VB4 class collections with collections

3. Collections in classes problem

4. problem w/ class collection

5. Custom Classes and Collections : Referencing Problem

6. Problem with COLLECTION CLASS - being forced to use .item(xx) to get members

7. Class Collection problems

8. Exposing Properties collection in custom classes as many MS Classes do

9. StatusBarPanel Collection containing panels based on different classes derived from StatusBarPanel class

10. Exposing a Properties collection in custom classes as many MS Classes do

11. Raising events from a class within a collection class

12. Class as collection of another class

 

 
Powered by phpBB® Forum Software