Win32, COM, DLLs and DirectX

Mark Hammond mhammond at skippinet.com.au
Sat Oct 19 21:19:20 EDT 2002


I'm afraid that pythoncom can not support calling vtable based 
interfaces.  You really have 3 options:

1) Help me fix this.  You need more C++/x86 experience that Python 
experience to help with this, but we have the other half of the problem 
solved (that Python can implement such interfaces) so is tractable.

2) Use some other tool.  SWIG may be a good candidate here, as that is 
how I previously wrapped exchange, ocx control, shell32 etc support. 
The tools are all in place in the win32com build setup.

3) Any option not one of the above <wink>.

Mark.


GambiT wrote:
> Hi everyone,
> 
> I am quite new to Python, and as a game developper I am looking forward
> using it in development tools (like graphical editors and so on).
> I know useful graphical libraries like OpenGL and SDL are available (not
> mentionning GUIs) from Python code, but I wanted to do a little check by
> myself about DirectX.
> 
> Talking about a specific tool, it can be possible to think about all DirectX
> features I need and use a DLL to be loaded in Python to call them. But for
> the moment I wanted to know how deep into DirectX I can dive from Python.
> 
> First thing I tried is COM objects, or I would better say DirectX Type
> Librairy for Visual Basic. I do not quite understand really what is the
> difference between this and an usual COM object, but it seems I cannot
> access DirectX features this way. At best, I can obtain a IDirectx8
> interface object, but no further (as DirectX methods are stored in vtables I
> cannot access and it seems other intrefaces do not support IDispatch - then
> I cannot instantiate any other type of object)
> 
> Then I looked at dynwin and calldll stuff, and loaded DX DLLs. Methods are
> accessible this way, but as there is no type support for DX objetcs this
> way, I cannot do much with returned objects (for example I can create a
> device from DX top-level interface loaded from the DLL, but then I cannot
> access the device object's methods)
> 
> I read on the pycom-dev ML that someone has coded the Invoke() and
> InvokeTypes() methods for PyITypeInfo, and making win32com.client support
> vtable interfaces. I am not there yet, as I do not have any experience of
> Python in-depth coding.
> 
> Could someone give me some advice, or someone has maybe run into the same
> problem. Any kind of help would be appreciated.
> 
> Thanks,
> Alexis
> 
> 




More information about the Python-list mailing list