|
-
August 19th, 1999, 07:37 AM
#1
ATL and Object Model (How to create a collection class)
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
-
August 27th, 1999, 07:49 PM
#2
Re: ATL and Object Model (How to create a collection class)
So you want that code to be converted to C++ code? Or did I totally miss what your asking?
Please clarify a bit.
Kevin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|