• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

idl, recordsets and collections?

Is it possible to pass a collection of recordsets between components using MS IDL? I.e., is there a collection type that MIDL recognizes, so I don't have to write my own custom marshaller?
1 Solution
Yes, it is possible. "Collection" COM object exists in VBA5.dll (it is a part of Visual Basic 5). Get this DLL, register and use "Collection" object to pass Recordsets the same way VB uses it.

barrettAuthor Commented:
OK, this seems like a good approach. I'm using vba6.dll, just to be modern. I find that it won't register using regsvr32 (no DllRegisterServer entry point), but that's OK, since I'm using C++/ATL. I import the dll using #import and rename the _Collection interface and its coclass, Collection, so they don't conflict with ADO's _Collection interface (I'm also using ADO).

Unfortunately, now I have problems. My C++ code can't find the coclass, Collection (now called VBCollection after my "rename" directive). When I look in the registry, no InProcServer is associated with the Collection class. Also, ATL should be wrapping the interface pointer in an ATL smart pointer, which appears to be happening in VBA6.tlh (there is a _COM_SMARTPTR_TYPEDEF for _VBCollection), but my C++ code doesn't recognize this fact.

So I'm kind of stuck. More brilliant insights welcome.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now