The idea is to create some add-on in a program using COM functions interface exist in his own API.
The particular type which I try to implement is a generic one , let say MyClass, and is declared like below:
//MyClassPtr declaration;
_COM_SMARTPTR_TYPEDEF(MyClass, __uuidof(IDispatch));
So I have to convert my variable MyClass (can be more than one in my code of course, but I want to limit only to one instance for now) to this SAFEARRAY .. How can I do this?
I try:
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 1;
long a=0;
Finally I put my class instance as an argument for:
FinalFunction(pMyInstance, .. , ..)
It doesn't seem to work, probably because argument pMyInstance can not be express as a VARIANT declarated type.
The class I want to work with - MyClass- which exist in a .tlh file, is part of the API interface, so it is not exactly a user define type, but more an interface define type. I mention this becose I try to work with VT_RECORD type in SafeArrayCreate(...) instead of VT_VARIANT type, but this imply an idl function declaration for my type, and other additional stuff
Re: HOW to convert an interface instance to SAFEARRAY
Hi kirants!
Thank you for your time to answer to my problem!
I'm new user with COM conversions and very confusing.. Please could you detailed your answer a little bit more ? I just ask for a start!
Kind regards!
Ioan
Bookmarks