Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 12807
  • Last Modified:

VB6 Dictionary Object

Hi,

I have created a VB class and during the running of my program many instances of this class are created...Is it possible to add these 'objects' (only of one Class type) into a VB Dictionary..? (Microsoft Scripting RunTime).

If the above answer is 'yes' I later need to loop through the Dictionary and process all the returned 'objects', this includes calling 'GetMethods( )' of the class objects. Can you give me an example...?

Thanks Ian

0
ISC
Asked:
ISC
1 Solution
 
aaarrrgggghhhCommented:
Yes you can do this if I've understood your question. Try something along the lines of...


Dim dicObjects as New Dictionary
Dim varKey as Variant

'add objects to dictionary e.g.
dicObjects.Add key1, Obj1
'...
dicObjects.Add keyN, ObjN

For Each varKey in dicObjects.Keys
    dicObjects(varKey).GetMethods()
Next



Hope this helps
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now