Reputation: 16101
I have written a class dll in Net that I have to expose to VB6 while we are migrating our application. This requirement is temporary so I want to make as little concessions as possible in the types that are used in the method calls and return values in the Net dll. The dll makes heavy use of IEnumerable<T
>, List<T
>, Dictionary<TKey,TValue
> and SortedDictionary<TKey,TValue
> as parameters and return values. Where can I find how to marshall these collections between Com and Net?
Upvotes: 1
Views: 277
Reputation: 24263
VB6 can enumerate any object that implements IEnumerable
.
IEnumerable<T>
interfaces are not exported to COM as it doesn't support generics, but you can return exactly the same enumerator object.
On the VB6 side, just use the usual For Each X In Y
loop.
Upvotes: 1