Matthias S
August 19th, 1999, 07:37 AM
In my ATL (DLL) project I want to create a collection class, that can be used in VB for example. The "Item Class" (let's call it 'car') has a property 'MaxSpeed'. The Collection Class (lets call it 'cars') has got an Add, Remove, Item (default) Method plus a count Property. VB Code to enumerate the class can look like this
Dim objCar as Car
Dim objCars as Cars
for each objCar in objCars
Debug.print objCar.MaxSpeed
next objCar
or like this
Dim objCar as Car
Dim objCars as Cars
Dim x as long
for x = 1 to objCars.count
Debug.print objCars(x).MaxSpeed
next x
I'm new to C++ and can't figure out how to do this. Where do I store internally the Collection? Does there a sample exist somewhere.
Lots of thanks,
Best wishes,
Matthias Steinbart
Dim objCar as Car
Dim objCars as Cars
for each objCar in objCars
Debug.print objCar.MaxSpeed
next objCar
or like this
Dim objCar as Car
Dim objCars as Cars
Dim x as long
for x = 1 to objCars.count
Debug.print objCars(x).MaxSpeed
next x
I'm new to C++ and can't figure out how to do this. Where do I store internally the Collection? Does there a sample exist somewhere.
Lots of thanks,
Best wishes,
Matthias Steinbart