[python-win32] how to get the interface of an COM object?

Bruce Who bruce.who.hk at gmail.com
Tue Nov 14 09:17:53 CET 2006


Hi, Thomas,

Thanks, I'll give it a try.

On 11/14/06, Thomas Heller <theller at ctypes.org> wrote:
> Bruce Who schrieb:
>
> > I googled the web and find some old posts in this maillist, it seems
> > that only interfaces inherit from IDispatch can be used by pythonCOM,
> > and interfaces here inherits from IUnknown. But I just need to use
> > these interfaces, so could anybody tell me how to do it?
> >
> > And this control and its interfaces are all available to VBScript or
> > Visual Bacis:
> >
> >    Set ISomeInterface_ = SomeObj.interface("ISomeInterface")
> >    ...
> >    <OBJECT ID="SomeObj"
> > CLASSID="CLSID:7A4F5191-68A8-14D5-82C1-0001083952C1" ></OBJECT>
> >
> > Since VBScript and python are both script languages, I guess python
> > can also access these interfaces.
>
> comtypes can call custom com interfaces:
>
> http://www.python.org/pypi/comtypes
>
> The downside is that there are no docs, yet.
>
> Thomas
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>


More information about the Python-win32 mailing list