[python-win32] Problem : COM with Array Argument
Tim Roberts
timr at probo.com
Mon Dec 19 23:59:22 CET 2011
Rand Batchelder wrote:
> I ran makepy on the DesignCad 20 type library.
>
> I get Type mismatch errors with the function GetPoints:
> ...
> def GetPoints(self, iStartIndex=defaultNamedNotOptArg,
> iCount=defaultNamedNotOptArg, pXYZArray=defaultNamedNotOptArg):
> return self._ApplyTypes_(15, 1, (2, 0), ((2, 1), (2, 1),
> (24581, 3)), u'GetPoints', None,iStartIndex
> , iCount, pXYZArray)
> """
> I tried Ent.GetPoints(1,1, d)
> where d is a list of 3 floats,
>
> I get the following errors:
> Traceback (most recent call last):
> ...
> File "C:\Python27\lib\site-packages\win32com\client\__init__.py",
> line 456, in _ApplyTypes_
> self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes,
> *args),
> com_error: (-2147352571, 'Type mismatch.', None, 3)
There's not an awful lot we can do here. Type code 24581 is a COM safe
array of doubles, passed by reference. That seems to be what the
documentation shows. You'd sure your values were all floats?
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list