well here's my problem:
i've got an interface pointer, it works nicely, i can reach all the methods
and whatnot. fine, but it has one property that gives me an IDispatchPtr
back... i know it can either be one of two interfaces but which one? how
can i determine to which interface this pointer is compliant? i need this
interface to reach further informations.
i read somewhere that you can use GetTypeInfo to retrieve some type-
lib stuff but it get's way to hard for a com beginner like me... what is all
that **** i just want to query the right interface of my dispatch pointer.
btw, it CAN be solved without type-informations but trying out all possible
interfaces until i get a non-null pointer is kind of stupid.
oh damn i didn't expected it to be THAT irritating - it's my second "com
the non-vb way" day and it is driving me nut's
can anybody help me out please?
thanks
i've got an interface pointer, it works nicely, i can reach all the methods
and whatnot. fine, but it has one property that gives me an IDispatchPtr
back... i know it can either be one of two interfaces but which one? how
can i determine to which interface this pointer is compliant? i need this
interface to reach further informations.
i read somewhere that you can use GetTypeInfo to retrieve some type-
lib stuff but it get's way to hard for a com beginner like me... what is all
that **** i just want to query the right interface of my dispatch pointer.
btw, it CAN be solved without type-informations but trying out all possible
interfaces until i get a non-null pointer is kind of stupid.
oh damn i didn't expected it to be THAT irritating - it's my second "com
the non-vb way" day and it is driving me nut's
can anybody help me out please?
thanks
okay i think i solved it (sorry, c++):
CComPtr<IDispatch> idpe = sketch->GetPlanarEntity();
CComPtr<ITypeInfo> tinf;
if( idpe )
{
idpe->GetTypeInfo( 0,0,&tinf );
TYPEATTR* ta;
tinf->GetTypeAttr(&ta);
if (ta->guid == IID__IRxWorkPlane )
...
else if (ta->guid == IID__IRxFace )
...
else ...
I have the same type of problem, except the answer could be an overwhelming number of Interfaces.
Could you or some, please translate your answer into assembler.
MASM32, I do not understand C code.
Thank you!
Could you or some, please translate your answer into assembler.
MASM32, I do not understand C code.
Thank you!
With out knowing exactly what your looking to do, I can suggest that using BiteRiders new OOP v1.3 programming model, you can handle this problem quite simply in a loop.
The returned IDispatch must be a valid COM object. Even though its not an OOP object as defined by his model that will be returned, the strict standards of COM ensures that his macros will work on *any* com interface object. Thus take the returned pointer and call:
ICall myIPointer::IDispatch.GetTypeInfo, 0, 0, addr TypeInfo
ICall TypeInfo::ITypeInfo.GetTypeAttr, addr TypeAttr
Then process and compare GUID's. All you would need to do is use the above two lines and include the macros/libruary.
Just a suggestion. If your interested, check out his work in the OOP section. ObjAsm32 v1.3
Regards,
:NaN:
The returned IDispatch must be a valid COM object. Even though its not an OOP object as defined by his model that will be returned, the strict standards of COM ensures that his macros will work on *any* com interface object. Thus take the returned pointer and call:
ICall myIPointer::IDispatch.GetTypeInfo, 0, 0, addr TypeInfo
ICall TypeInfo::ITypeInfo.GetTypeAttr, addr TypeAttr
Then process and compare GUID's. All you would need to do is use the above two lines and include the macros/libruary.
Just a suggestion. If your interested, check out his work in the OOP section. ObjAsm32 v1.3
Regards,
:NaN:
Nan:
Sorry for being late on the reply :oops:
Ok, Thanks I will give it a try.
Sorry for being late on the reply :oops:
Ok, Thanks I will give it a try.
Check out the COM intefaces provided (E:\masm32\ObjAsm32\Code\COM\COM_Interfaces.inc). A good number of interaces are already supported, I ITypeInfo is one of them. If its not in the COM interfaces you will have to define it manually or use Japheth's COMView.
Also check out the transcription i did from Ernie's ShortCut COM example. IShellLink & IPersistFile was not part of the package, so I defined them manually. This should give you a good feel for how to set up the assembler to understand what interfaces you want to work with.
If yo need futher help, just ask.
Regards,
:NaN:
Also check out the transcription i did from Ernie's ShortCut COM example. IShellLink & IPersistFile was not part of the package, so I defined them manually. This should give you a good feel for how to set up the assembler to understand what interfaces you want to work with.
If yo need futher help, just ask.
Regards,
:NaN:
Nine out of ten times, it's going to be fine to enumerate type information via the normal mechanisms, but be aware that some COM servers don't follow the rules... they could for example register modified and incorrect typelib information after the first (and only legitimate) client instance connects to it, etc.
If that's the case, you probably shouldn't be trying to use it :)
If that's the case, you probably shouldn't be trying to use it :)