[python-win32] Re: Trying to use DirectX

Jeff Shannon jeff@ccvcorp.com
Fri, 25 Oct 2002 09:37:38 -0700


>
> From: Kerim Borchaev <warkid@hotbox.ru>
>
> Is it possible to use DirectX typelibrary with Python?
>
> When I try this script:
>
> import win32com.client
> win32com.client.Dispatch('DIRECT.DirectX8.0')
>
> I get this error:
> [...]
> pywintypes.com_error: (-2147467262, 'No such interface supported', None, None)

If I'm not mistaken, the PythonCOM framework currently only supports COM servers that offer Automation -- that
is, they expose an IDispatch interface.  DirectX does not offer such an interface, so it's not really possible
to use it.  IIRC, automatic support of arbitrary COM interfaces was deemed to be too difficult to be
practical.  I seem to remember seeing some discussion, quite a while back, about the possibilities of
custom-coding a PythonCOM wrapper for specific interfaces.  If you were to do that for every DirectX interface
you needed, then presumably you could use the rest of the win32com framework with those interfaces.

Jeff Shannon
Technician/Programmer
Credit International