accessing an OLE Automation (IDispatch) server from python which requires the use of "out params"

Paul Kölle paul at subsignal.org
Tue Dec 11 09:42:35 CET 2012


Hi,

Am 10.12.2012 20:13, schrieb bitbucket:
> I have an existing Windows application which provides an OLE
> Automation (IDispatch) interface.  I'm not able to change that
> interface.  I'd like to call it from a scripting language.  I figure
> this would provide a nice quick way to invoke on the app.
>
> I initially tried this with Windows Powershell but ran into the
> following problem.  I was able to create the object and invoke simple
> methods on it.  However the interface for this app has methods which
> take out params.  i.e. you pass in a reference to a variable and the
> server fills in the value.  I couldn't get that to work.  I finally
> gave up and decided it was just a limitation of Powershell, not being
> able to work with those out params.

[snipp]
Before switching technologies I'd check if this solves your problem 
http://geekswithblogs.net/Lance/archive/2009/01/14/pass-by-reference-parameters-in-powershell.aspx 


TL;DR IMHO "out" parameters are basically pointers (pass by reference) 
and need to be passed like GetSettingValue("name", [ref]$value)...

cheers
  Paul




More information about the Python-list mailing list