views:

26

answers:

1

I already tried ArrayList^ and VB6 gives me a 'Type mismatch' error. I don't see a C++/CLI 'Collection' or 'List'.

So what is the equivalent, if there is one?

+1  A: 

Yeah, doesn't work, VB6 wants its own Collection class. I'm fairly shocked how that turned out. I thought, easy peasy, just add a reference to c:\windows\system32\msvbvm60.dll and use the interop library that generates. Then:

VBA::Collection^ coll = gcnew VBA::Collection();

Kaboom:

 Retrieving the COM class factory for component with CLSID {A4C4671C-499F-101B-BB78-00AA00383CBB} failed due to the following error: 80040154.

Class not registered. Looked in the registry, it's there under HKLM\CLSID but the InprocServer32 key is blank. Blank. That's not good. Changed it to point to point to msvbvm60.dll. Kaboom, 0x80040111, "ClassFactory cannot supply requested class".

This isn't going to fly. Abandon all hope the way I see it, unless you can refactor the VB6 code.

Hans Passant
Or he can make a custom `VBA.Collection` factory in VB6 -- a multi-use class with a single method `NewCollection` that returns `New Collection`
wqw
Agreed, that would work.
Hans Passant