PythonCOM Problem: Automating WinFAX from Python

Stefan Schukat SSchukat at dspace.de
Thu May 23 10:16:24 EDT 2002


Hi,

to use the function non dynamically the following could work.

# Import gencache library for on demand module creation
from win32com.client import gencache

# Get the module either via cache (ID of the winfay library , Locale,
VersionMajor, VersionMinor)
Module = gencache.EnsureModule("808D9041-49C1-11CE-A7FB-444553540000", 0x0,
1, 0)

# Create the object via the module
sendobj = Module.CSDKSend() # instead of
win32com.client.dynamic("WinFax.SDKSend")

# Create the wrapper class around the untyped Application object
appObj = Module.COleWinFaxApp(sendobj.Application)

# Call the byref function
Result, Status = appObj.GetAutoRecieve(Device, Status)

To make things easier you could change the generated wrapper to give
the Python COM infrastructure more information.


	Stefan



-----Original Message-----
From: tl_news at nexgo.de [mailto:tl_news at nexgo.de]
Sent: Thursday, May 23, 2002 1:28 PM
To: Stefan Schukat
Subject: Aw: RE: PythonCOM Problem: Automating WinFAX from Python


Hi!

> this is a property with an parameter. Since in Python is
> no concept like call by reference. You have to use the
> makepy generated wrapper (Either by makepy or EnsureDispatch) to call 
> such a function. This wrapper translates the call to:
> 
> >>> Result, Status = appObj.GetAutoRecieve(Device, Status)
> 
> Why there is a typeerror depends on the implementing object.

The Problem is that the COM Objects are all in "WinFax Automation Server
1.0"
and the one I want to use is for example "WinFax.SDKSend" or
"WinFax.SDKPhonebook"

I can create the gen_py wrapper for the "WinFax Automation Server" but then
it doesn't detect that "WinFax.SDKSend" is one of those objects and binds it
dynamically.

> I must have a look at the makepy wrapper to tell you more.
Attached you'll find the gen_py generated wrapper. Maybe you can help?

Thanks a lot, Stefan!

Tino

-----------------------------------------------------------------------
PCs & Notebooks bei eBay. Riesenauswahl an neuen und gebrauchten Geräten
aller Anbieter. Ob Thinkpad oder Vaio - Preise vergleichen, Preise
mitbestimmen - kaufen und verkaufen! Startpreise ab EUR 1,-
http://www.arcor.de/home/redir.php/ebaymai
-----------------------------------------------------------------------





More information about the Python-list mailing list