Python win32com com_error: (-2147418113


G

g.franzkowiak

I'm trying to use a proprietary windows software with COM and win32com.
The result is everytime the error message

com_error: (-2147418113, 'Catastrophic failure', None, None)

I've read this in some e-mails, but can't find the solution and I have
not enough experience with Windows and COM.

Can anybody help ?

This ist the test script.

#--------------------------------------------------------------------------
import sys
from win32com.client import gencache
import win32com.client

if __name__=='__main__':

flag = None
gencache.EnsureModule('{A5FE85B0-D562-11D3-A8E8-00609727A3F3}', 0, 1, 0)
o =
win32com.client.Dispatch('VISIONP400DATACONTROL.VisionP400DataControlCtrl.1')

"""
Debug output:
o ==>
<win32com.gen_py.A5FE85B0-... instance at 0x17707056>
o.connectToVisionP400 ==>
<bound method_D....>
"""

try:
flag = o.connectToVisionP400()

"""
Error by function call ==>
>>> Unhandled exception while debugging...
Traceback (most recent call last):
File "S:\Python\DCOM\test.py", line , in ?
flag = o.connectToVisionP400()
File
"C:\Programme\Python\Python2.4\lib\site-packages\win32com\gen_py\A5FE85B0-D562-11D3-A8E8-00609727A3F3x0x1x0.py",
line 60, in connectToVisionP400
return self._oleobj_.InvokeTypes(12, LCID, 1, (11, 0), (),)
com_error: (-2147418113, 'Catastrophic failure', None, None)
"""

except:
flag = "*** - The connection not possible !"

print flag



Regards
gerd
 
Ad

Advertisements

R

Roger Upole

Usually this means the COM object has to run in a full ActiveX container.
You can host it in IE, or Pythonwin can act as a container with some effort.
See \pythonwin\pywin\Demos\ocx for some examples of using OCX objects
that require a container.

Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top