You should just be able to run makepy, then use win32com.client.Dispatch
as normal. Evertthing should "just work" (but unfortunately doesn't for
some).
you passed an incorrect type.
Can you post the complete interactive session, and the traceback. Also
please include a "print repr(ob)" in the output, where "ob" is the COM
object you are trying to call.
Hi Mark,as normal. Evertthing should "just work" (but unfortunately doesn't for
some).
com_error: (-2147352567, 'Exception occurred.', (0, 'TGLLib', 'Type
mismatch', None, 1000013, -2146828275)
This means that TGLLib itself threw an exception. This often means thatmismatch', None, 1000013, -2146828275)
you passed an incorrect type.
Can you post the complete interactive session, and the traceback. Also
please include a "print repr(ob)" in the output, where "ob" is the COM
object you are trying to call.
Here's the interactive session...
from win32com.client import Dispatch
myTGL = Dispatch("TGLLib.TGLFile")
print repr(myTGL)
myTGL = Dispatch("TGLLib.TGLFile")
print repr(myTGL)
myTGL.Filename="D:\myTGL.tgl"
myTGL.Load()
print repr(myTGL.Strings)
myTGL.Load()
print repr(myTGL.Strings)
myTGL.Strings.Lookup()
myTGL.Strings.Add(Name=u'Name', Data=u'This is my data',
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "D:\Python22\Lib\site-packages\win32com\gen_py\22E8D31A-01EE-4EB1-9AED-07264C052957x0x25x0.py",
line 65, in Add
return self._ApplyTypes_(0x60030003, 1, (9, 0), ((16392, 3),
(16392, 3), (16392, 3), (16396, 19)), 'Add',
'{248731B8-8D33-4B18-9219-240086A375F6}',Name, Data, Media, Key)
File "D:\Python22\Lib\site-packages\win32com\client\__init__.py",
line 341, in _ApplyTypes_
return self._get_good_object_(apply(self._oleobj_.InvokeTypes,
(dispid, 0, wFlags, retType ,argTypes ) + args), user, resultCLSID)
com_error: (-2147352567, 'Exception occurred.', (0, 'TGLLib', 'Type
mismatch', None, 1000013, -2146828275), None)
>>>
Hope it sheds some light on things...
Simon