[python-win32] I do not manage to call methods in automated objects since InvokeTypes() fails
Amir Ein Dor
aeindor at FORSK.com
Mon Aug 28 11:48:35 CEST 2006
Dear python-win32 volunteers
(I resent this mail because before I was not a subscriber)
I was hopping to manage to introduce python into our product, starting
with testing utilities and then who knows ...
But I am blocked with the following:
I am trying to write a client application that uses our com server
(automated) interface.
Usually VB scripts or C++ programs provide these client applications.
I use early binding by running makepy.
I manage to access all propertied, yet do not manage to call methods.
The InvokeTypes() fails:
For example, if I call
Obj.Item(7)
I get:
File
"C:\Python24\lib\site-packages\win32com\gen_py\A9ADC630-3FE3-11D0-935B-0
00000000000x0x1x0.py", line 206, in Item
ret = self._oleobj_.InvokeTypes(5, LCID, 2, (9, 0), ((3, 1),),iIdx)
com_error: (-2147352562, 'Invalid number of parameters.', None, None)
yet if I call
y = Obj[7] I pass by the standard method _NewEnum() and I manage to get
my object.
def _NewEnum(self):
iid = '{1DA961EB-FB92-484C-84F4-F39BA9370C86}'
par = self._oleobj_.InvokeTypes(-4, LCID , 2, (13,10),())
return win32com.client.util.WrapEnum(par,iid)
In this case, InvokeTypes() seems to succeed.
Do you have any idea of what is wrong?
I tried to switch from (9,0) (3,1) being a DISPATCH return value, to
(13,0) being a IUNKNOWEN returen value ... but no good.
I have very little time left now, if I don't solve this problem, I will
have to do my tests in VB script (yack)
Please help
Thanks in advanced
Amir
Amir Ein-Dor
Senior Engineer
Tel: +33 (0)562 745 027
www.forsk.com
PS an other information that may help:
I tried to switch to late binding by removing the
A9ADC630-3FE3-11D0-935B-000000000000x0x1x0.py
File. In this case, the methode Item() was called, yet with my c++
Debugger I could see that the VARIANT variable had a VT_ERROR type.
More information about the Python-win32
mailing list