|
-
Jan 30th, 2001, 09:01 AM
#1
Thread Starter
Addicted Member
Hi..
I have this property :
Public Property Get NewEnum() As IUnknown
'this property allows you to enumerate
'this collection with the For...Each syntax
Set NewEnum = mCol.[_NewEnum]
End Property
I am trying to use it to go through my collection of objects. mCol is a collection of objects. I dont have a clue what IUnknown is. This property was automatically created by VB itself. Can anyone help me in using this property in a For.. Each syntax. HELP PLEASE!!!
Collection Class is called Products
Single Class is called Product
mCol has the following properties:
mCol(Index)
mCol.Item. -> then properties of the single class Product
mCol.Add
mCol.Remove
mCol.Count
Basically i want to Enumerate all the objects then use mCol(Index) to list them in...
Please Help me
-
Jan 30th, 2001, 09:41 AM
#2
transcendental analytic
Code:
For each n in mCol
'process item n
next n
where as n has to be a variant for regular datatype, except UDT's, and any object variable matching all objects in collection
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jan 30th, 2001, 09:57 AM
#3
Addicted Member
You don't have to change anything to the code for it to work. You just have to go to the 'Tools' menu and select 'procedure attributes'.
Now select the NewEnum procedure and make sure you see the details. Now set the Procedure_ID to -4. This isn't a normal option so don't use the dropdownbox. Also click on the 'Hide this member checkbox'.
Now you enumerator is ready. You will have to retrieve Variants when using a for ech ..... next structure.
Catch you later,
Jeroen Hoekemeijer
Code:
If 1 = 2 Then MajorError
-
Jan 30th, 2001, 10:09 AM
#4
Addicted Member
I would like to know if it's possible to change the IUnkown in a known object.
example
Code:
Public Property Get NewEnum As Form
Set NewEnum = mCol.[_NewEnum]
End Property
I hope that this way I do not have to pull the object with a Variant.
Catch you later,
Jeroen Hoekemeijer
Code:
If 1 = 2 Then MajorError
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
|