VB6 cast generic collection item to custom class

G

Guest

Hi. My VB6 application has several collections of custom classes, and each class has differing properties (ie. the classes are not necessarily related). I want to write a generic function which can be passed any collection in order to populate a control based on the objects in the collection. I figure I would have to pass the type of object into the function too in order to be able to cast each item of the collection, plus, say, a string array of field names (representing class properties) the user wanted to display in the control. Any pointers how to do this

Thank

Dav
 
G

Guest

I appear to have underestimated VB6 here. I do not need to cast a collection item to access it's properties. However, I still need the ability to access an object's properties using a string representation of each property name. I have posted a new question under the title "VB6: Access object properties by name"

DT
 
C

Cor Ligthert

Hi Dave,

Did you know this is a VB.net newsgroup. The language is a look a like for
VB 6 however the use of it is when done well completly different.

There are a lot of newsgroups

microsoft.public.VB which are for classic VB

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top