<div dir="ltr"><div>Dear All,</div><div><br></div><div>I am facing a problem passing an array by reference. It is exactly the </div><div>same problem as described in this thread:</div><div><br></div><a href="https://mail.python.org/pipermail/python-win32/2002-November/000562.html">https://mail.python.org/pipermail/python-win32/2002-November/000562.html</a><br>
<div><br></div><div>In short, I have a valid reference to a Position object. This object has two methods,</div><div>GetComponents and SetComponents that each take a CATSafeArrayVariant as </div><div>an argument. This CATSafeArrayVariant should in this case be a one-dimensional</div>
<div>array of real values.</div><div><br></div><div>A CATSafeArrayVariant is a typedef for a CATVariant which itself is (exactly</div><div>copied from the documentation) "typedef any CATVariant".</div><div><br></div>
<div>I tried the obvious ways of passing standard python tuples and lists of size 12. </div><div>The calls itself succeed, however the values are never updated.</div><div><br></div><div>I also tried the new VARIANT object with different type specifiers, but I always</div>
<div>get the error message:</div><div> TypeError: Objects for SAFEARRAYS must be sequences (of sequences), </div><div> or a buffer object<br></div><div><br></div><div>I do not have access to either the IDL description or sourcecode for the call. In</div>
<div>addition, I cannot find the Get/SetComponent methods when I run makepy.</div><div><br></div><div>All in all, not the best situation. It is a little frustrating, because I have 95% of the</div><div>functionality I need up and running in Python instead of VBA. This way it perfectly</div>
<div>fits in the rest of the code I have, so if I can avoid switching to VBA, it would be</div><div>great. By the way, the call works fine in VBA.</div><div><br></div><div>Does anybody have an idea on how to solve this?</div>
<div><br></div><div>Kind regards,</div><div><br></div><div>Marco</div><div><br></div><div><br></div></div>