Win32ole problem with put property

I’m trying to drive Windows Installer via its automation interface
using Ruby and win32ole. The Record object (for accessing records in
the Installer tables) has get and put properties for getting/putting a
specific column specified by an index. The IDL definitions are as
follows…

[id(0x00000001), propget, helpcontext(0x00002456)]
BSTR StringData([in] long Field);

[id(0x00000001), propput, helpcontext(0x00002456)]
void StringData(
[in] long Field,
[in] BSTR rhs);

Now to get the value of a column of the record in Ruby, the following
works fine…

sValue = oRecord.StringData(1)

But I can’t figure out how to put a column value? In VB, the
following works…

oRecord.StringData(1) = “new value”

But neither of these work in Ruby…

oRecord.StringData(1, “new value”)
oRecord.StringData(1) = “new value”

Any ideas anyone?

I’d start by seeing what methods are available. Stick in something
like:

p oRecord.StringData(1).ole_methods
p oRecord.StringData(1).ole_get_methods

(For some reason, these can return different data, so it’s good
to look at both.)

You may see the right way of setting the property that you’re
looking for.

– Dossy

···

On 2002.07.17, BJ bruce.james@trimble.co.nz wrote:

But neither of these work in Ruby…

oRecord.StringData(1, “new value”)
oRecord.StringData(1) = “new value”


Dossy Shiobara mail: dossy@panoptic.com
Panoptic Computer Network web: http://www.panoptic.com/
“He realized the fastest way to change is to laugh at your own
folly – then you can let go and quickly move on.” (p. 70)