S
Scott M. Lyon
As I mentioned in my other post, I'm attempting to, using COM Interop so I
can update existing VB6 code to (for several specific functions) return a
Hashtable from a .NET library.
I've had very little luck processing the Hashtable itself in VB6 (I can add
a reference to the project so it knows what a Hashtable is, but I'm not
having much luck looping through all objects in the Hashtable), so I decided
to try a different idea.
I thought I'd write a quick function (in .NET) that would convert the
Hashtable to a more-vb6-friendly Collection object instead. That way VB6
could call the function to return the Hashtable, then use that return value
to call my new ConvertToCollection function, returning a Collection.
Problem: for some reason, every time I call a .NET function that returns a
Collection object from VB, if I try to put the return value in a (VB6)
Collection, I geta "type mismatch" error.
I can store the (.NET) Collection in a (VB6) Variant, but when I try to
assign THAT value to my (VB6) Collection, I get the "type mismatch" again...
It's making me wonder if the .NET Collection object is incompatible with the
VB6 Collection object.
Can anyone confirm this? Or least offer suggestions how I can get past this,
so I can work with the data from my Hashtable/Collection from VB6?
Thanks!
-Scott
can update existing VB6 code to (for several specific functions) return a
Hashtable from a .NET library.
I've had very little luck processing the Hashtable itself in VB6 (I can add
a reference to the project so it knows what a Hashtable is, but I'm not
having much luck looping through all objects in the Hashtable), so I decided
to try a different idea.
I thought I'd write a quick function (in .NET) that would convert the
Hashtable to a more-vb6-friendly Collection object instead. That way VB6
could call the function to return the Hashtable, then use that return value
to call my new ConvertToCollection function, returning a Collection.
Problem: for some reason, every time I call a .NET function that returns a
Collection object from VB, if I try to put the return value in a (VB6)
Collection, I geta "type mismatch" error.
I can store the (.NET) Collection in a (VB6) Variant, but when I try to
assign THAT value to my (VB6) Collection, I get the "type mismatch" again...
It's making me wonder if the .NET Collection object is incompatible with the
VB6 Collection object.
Can anyone confirm this? Or least offer suggestions how I can get past this,
so I can work with the data from my Hashtable/Collection from VB6?
Thanks!
-Scott