[python-win32] how to get the interface of an COM object?
Thomas Heller
theller at ctypes.org
Tue Nov 14 08:09:44 CET 2006
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
More information about the Python-win32
mailing list