win32com and parameters on property "put" methods
Mark Hammond
mhammond at skippinet.com.au
Mon Jan 21 22:36:44 EST 2002
David Bolen wrote:
> A co-worker has been writing some Python code to use some internal COM
> objects (in C++) that he had previously developed, and ran into a
> problem scenario using some of his properties.
>
> He's got some properties where the "put" method for that property
> takes additional parameters beyond just the new value for the
> property.
>
> Not being intimately familiar with such beasts, I have no idea if
> that's a good thing to do or something generally supported by other
> languages (in C++ you just call the method directly so it clearly
> works there), but he indicated that to support it in VB, you could do
> something like:
>
> print msfStack.PlateValue(3)
> 7000
> msfStack.PlateValue(3) = 6000
> print msfStack.PlateValue(3)
> 6000
If you use makepy on the type library, viewing the generated file should
show a "Set" method - eg:
msfStack.SetPlaceValue(3, 6000)
Should work.
Mark.
More information about the Python-list
mailing list