reading a VB6 Collection object in C#
Tech-Archive recommends: Fix windows errors by optimizing your registry
I'm working on a project that uses some older VB6 COM objects. One of
the classes returns a Collection object, which I am having trouble
reading in C#. Can someone point me in the right direction here...
ComObject objItemType = new ComObject("Items");
args = new object[0];
VBA.Collection coll = objItemType.doMethod("GetTypes",args); // This
method is returning a collection
Now, I know the method call is working OK and actually returning data,
because the Count property of coll is set correctly. But I cannot get
at the individual items, which in this case is another VB6 COM object.
Everything I've tried (foreach, indexer, etc.) either fails at compile
or run time.
What is the correct way to access these objects in the collection???
Is VBA.Collection not the correct object? Do I need to cast it to
something else? This is driving me crazy.
.
Relevant Pages
- Re: Returning a Collection object from .NET to VB6 (using COM Interop)
... And it fails on that Set statement with the "Type Mismatch". ... So I changed the VB6 code to the following: ... > Hashtable to a more-vb6-friendly Collection object instead. ... so I can work with the data from my Hashtable/Collection from VB6? ... (microsoft.public.dotnet.languages.vb) - Re: VBA/VB6 Collection Type Mismatch
... combination with VB6 then there could very well be a problem, ... except a couple of rogue machines. ... > It looks to me like the VBA collection object on these machines does ... This reply is posted in the Newsgroup; ... (microsoft.public.office.developer.vba) - Reading a VB6 Collection object?
... I'm working on a project that uses some older VB6 COM objects. ... the classes returns a Collection object, which I am having trouble ... reading in C#. Can someone point me in the right direction here... ... (microsoft.public.dotnet.general) - Returning a Collection object from .NET to VB6 (using COM Interop)
... I've had very little luck processing the Hashtable itself in VB6 (I can add ... Hashtable to a more-vb6-friendly Collection object instead. ... so I can work with the data from my Hashtable/Collection from VB6? ... (microsoft.public.dotnet.languages.vb) - Re: Cracking ConfigurationManager
... My experience with VB6 is that it makes easy things ... Reading and writing to a text file ... you'd have to parse the .config file as an XML ... files (streams) on disk, then it is a relatively TRIVIAL effort to ... (microsoft.public.dotnet.languages.csharp) |
|