and you get a VARIANT with VT_UNKNOWN as a result.
you go...
objects.
Gary Chang[MSFT] wrote:
Hi Rob,
Does anyone have pointers to some documentation
or books (preferably something in O'Reilly's Safari collection, but I'm
not picky) which could guide me on how to define the get_ and put_
properties?
I am not familar with the O'Reilly's Safari books, but I found some code
samples and atricles on how to implement a VBA like collection in ATL:
Safari is not an imprint of O'Reilly's. It's their online library of
books, which includes several imprints, but sadly none of the Microsoft
Press books.
Even so, I don't want to *create* a VBA-like collection in ATL. I want to
*use* a VBA.Collection object created in VB6 and set as a property in my
ATL object. Presumably that means I take a reference passed in by my VB6
application, and either copy
CComPtr<VBA::Collection> ptr = pVal //?
or QI
CComPtr<VBA::Collection> ptr;
pVal->QueryInterface(IID_theIIDoftheVBACollectionClass, &ptr); //?
...the reference to store my pointer internally in my ATL/COM object.
I can't remember whether VB6 will addref the object when it calls out to
an inproc DLL or not (I'm thinking not). I suppose I could pass the
pointer "as Object" and QI in any case, but I still need to know where and
how to get at the methods of the VBA Collection class once the object is
marshalled in and I have a reference.
So... still lost, because I'm not trying to duplicate Collection
functionality for myself, I'm trying to use an object created for me by
VB6 inside my ATL8 class.
And naturally, I can't resist snarking a bit, that if the
VFW/DirectShow/Windows Media people had written managed interfaces for
their stuff in all the years .NET has been around, this wouldn't even be a
question.
Rob