Accessing multiple interfaces in a COM object

Mark Hammond MarkH at ActiveState.com
Tue May 22 03:07:08 CEST 2001


Don Dwiggins wrote:

> For example, when I try (based on one of the messages):
>    o = Dispatch('dll.class1')
>    o._oleobj_.QueryInterface('IID-string-for-iA',pythoncom.IID_IDispatch)
> I get
>    <PyIDispatch at 0x1391044 with obj at 0x148d2c>


This IDispatch object should work OK.  Eg:

o = Dispatch('dll.class1')
o2 = o._oleobj_.QueryInterface('IID-string-for-iA',pythoncom.IID_IDispatch)
# Wrap it in a friendly IDispatch wrapper
o2 = Dispatch(o2)

Should leave you with an object that works fine.

Mark.




More information about the Python-list mailing list