comtypes CreateObject problem
Maria R
Maria.Reinhammar at accalon.com
Wed Apr 1 10:19:25 EDT 2009
We get the following, less favourable respons :o(
Any advice is greatly appreciated!!
Setting is python 2.5.2, windows xp professional SP3, SolidEdge V20
SP10
We have success with comtypes interfacing other software like SmarTeam
(PDM/PLM software) and of course Excel and alike.
Thnx
IDLE 1.2.2
>>> import comtypes.client
>>> foo = comtypes.client.CreateObject("SolidEdge.Application")
# Generating comtypes.gen._8A7EFA3A_F000_11D1_BDFC_080036B4D502_0_1_0
# Generating comtypes.gen._00020430_0000_0000_C000_000000000046_0_2_0
# Generating comtypes.gen.stdole
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
foo = comtypes.client.CreateObject("SolidEdge.Application")
File "C:\Python25\lib\site-packages\comtypes\client\__init__.py",
line 204, in CreateObject
return _manage(obj, clsid, interface=interface)
File "C:\Python25\lib\site-packages\comtypes\client\__init__.py",
line 165, in _manage
obj = GetBestInterface(obj)
File "C:\Python25\lib\site-packages\comtypes\client\__init__.py",
line 102, in GetBestInterface
mod = GetModule(tlib)
File "C:\Python25\lib\site-packages\comtypes\client\_generate.py",
line 112, in GetModule
mod = _CreateWrapper(tlib, pathname)
File "C:\Python25\lib\site-packages\comtypes\client\_generate.py",
line 188, in _CreateWrapper
mod = _my_import(fullname)
File "C:\Python25\lib\site-packages\comtypes\client\_generate.py",
line 26, in _my_import
return __import__(fullname, globals(), locals(), ['DUMMY'])
File "C:\Python25\lib\site-packages\comtypes\gen
\_8A7EFA3A_F000_11D1_BDFC_080036B4D502_0_1_0.py", line 3393, in
<module>
( ['in'], POINTER(_midlSAFEARRAY(c_char)), 'Accelerators' )),
File "C:\Python25\lib\site-packages\comtypes\safearray.py", line 18,
in _midlSAFEARRAY
sa_type = _make_safearray_type(itemtype)
File "C:\Python25\lib\site-packages\comtypes\safearray.py", line 52,
in _make_safearray_type
raise TypeError(itemtype)
TypeError: <class 'ctypes.c_char'>
>>>
More information about the Python-list
mailing list