'Catastrophic failure's trying to use OCX
Gary Stephenson
garys at ihug.com.au
Mon Apr 7 18:24:23 EDT 2003
I am trying to interface to an .OCX file. After successfully running makepy
over it, this is what happens:
ActivePython 2.2.2 Build 224 (ActiveState Corp.) based on
Python 2.2.2 (#37, Nov 26 2002, 10:24:37) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32com.client
>>> x1 = win32com.client.Dispatch('PosEft.PosEftCtrl.1')
>>> `x1`
'<win32com.gen_py.PosEft ActiveX Control module._DPosEftMethods>'
>>> x1.ApiVersion
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\activePython22\Lib\site-packages\win32com\client\__init__.py",
line 3
47, in __getattr__
File "C:\activePython22\Lib\site-packages\win32com\client\__init__.py",
line 3
41, in _ApplyTypes_
pywintypes.com_error: (-2147418113, 'Catastrophic failure', None, None)
>>>
Exactly the same thing occurs if I use late-binding instead (via
win32.com.client.Dispatch.dynamic('....').
What am I doing wrong?
many tias,
gary
More information about the Python-list
mailing list