<div dir="ltr">Hi Tim,<div><br></div><div>Your answer implies that they are not declared correctly, because the</div><div>parameter is really required. It throws an exception with "invalid</div><div>number of parameters" if you leave it out.</div>
<div><br></div><div>If the type is somehow not declared correctly, is there a workaround?</div><div><br></div><div>Marco</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 17, 2014 at 7:36 PM, Tim Roberts <span dir="ltr"><<a href="mailto:timr@probo.com" target="_blank">timr@probo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Marco Nawijn wrote:<br>
><br>
> I am facing a problem passing an array by reference. It is exactly the<br>
> same problem as described in this thread:<br>
><br>
> <a href="https://mail.python.org/pipermail/python-win32/2002-November/000562.html" target="_blank">https://mail.python.org/pipermail/python-win32/2002-November/000562.html</a><br>
><br>
> In short, I have a valid reference to a Position object. This object<br>
> has two methods,<br>
> GetComponents and SetComponents that each take a CATSafeArrayVariant as<br>
> an argument. This CATSafeArrayVariant should in this case be a<br>
> one-dimensional<br>
> array of real values.<br>
<br>
</div>If these are declared correctly in their type library, then the array<br>
should be an output value, and Python's machinery knows how to handle<br>
that. So:<br>
<br>
hr, bfr = obj.GetComponents()<br>
hr = obj.SetComponents(bfr)<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Tim Roberts, <a href="mailto:timr@probo.com">timr@probo.com</a><br>
Providenza & Boekelheide, Inc.<br>
<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-win32" target="_blank">https://mail.python.org/mailman/listinfo/python-win32</a><br>
</font></span></blockquote></div><br></div>