PythonCOM Problem: Automating WinFAX from Python

Mark Hammond mhammond at skippinet.com.au
Thu May 23 02:08:49 EDT 2002


Tino Lange wrote:


> The function I want to use now on the "appObj" is "GetAutoRecieve()".
> It's signature in C++ is
> 
> short GetAutoRecieve(LPCTSTR sDevice, short FAR * nStatus)
> 
> How can I code this in Python? How to emulate a pointer to an integer?

If you run makepy over the type library, it should be "magic", and 
something like:

   rc, status = app.GetAutoRecieve("whatever")

or, in the more likely case that the "short" is actually the HRESULT, it 
will just be:

   status = app.GetAutoReceive ...

This latter will always work (even if there are multiple return types), 
so try this and simply print the value of "status" to see if it is a 
tuple (multi-return) or a simple value (single return).

Mark.




More information about the Python-list mailing list