PythonCOM Problem: Automating WinFAX from Python

Tino Lange tl_news at nexgo.de
Tue May 21 12:38:17 EDT 2002


Hi!

I have a problem with com-based WinFAX (10.02) remote programming.
According to the SDK documentation I need to dispatch an arbitrary
SDKObject to get the pionter to the "mother-object" Application
Server.

"The Application Object is not accessible through "CoCreateInstance"
or CoGetClassObject" as there are no registry entries associated with
this object. The client usually holds a pointerto one of the other
WinFax Automation Server Interfaces, which it can use to obtain the
application object."

In short:

How can I translate the following C++-Code to python?

// Create application object
if (m_sendObj.CreateDispatch("WinFax.SDKSend"))
{
  m_appObj.AttachDispatch(m_sendObj.GetApplication());
  m_appObj.LeaveRunning(1);
  m_sendObj.ReleaseDispatch();
  ...
}


This doesn't work:

>>> import win32com
>>> import win32com.client
>>> send_obj = win32com.client.Dispatch("WinFax.SDKSend")
>>> send_obj.GetApplication()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\PROGRA~1\Python2.1\win32com\client\dynamic.py", line 438,
in __getatt
r__
    raise AttributeError, "%s.%s" % (self._username_, attr)
AttributeError: WinFax.SDKSend.GetApplication
>>> send_obj.GetApplication
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\PROGRA~1\Python2.1\win32com\client\dynamic.py", line 438,
in __getatt
r__
    raise AttributeError, "%s.%s" % (self._username_, attr)
AttributeError: WinFax.SDKSend.GetApplication
>>> 

Any ideas or hints?
Thanks a lot for your help!

Tino
 



More information about the Python-list mailing list