use win32 COM in python

Miki Tebeka miki.tebeka at zoran.com
Mon Aug 30 23:23:07 CEST 2004


Hello Lin,

>   I have a C++ implemented COM server that give out a method like: int
> read(unsigned char* buf, int lenth), How can I use this method from python?
> what is the signature?
> or anyone can tell me how should I design the COM interface so I can use
> python to read a chunk of bytes from a C++ implemented COM server.
You can avoid COM and either get this server as a Python module using
SWIG/Boost.Python/Pyrex ...

You can also use a regular DLL using ctypes package.

However if you *must* use COM then make sure your server has a Dispatch
interface and just use win32com.client.Dispatch to create and use it.

Bye.
--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka at zoran.com>
http://tebeka.spymac.net
The only difference between children and adults is the price of the toys



More information about the Python-list mailing list