David Vallner
8/25/2006 8:56:00 PM
Patrick Spence wrote:
> Has anyone done something like this? If so, how? It doesn't
> seem to be as straight forward as a VB6 COM .dll.
Amusingly enough:
irb(main):001:0> require 'win32ole'
=> true
irb(main):002:0> lst = WIN32OLE.new("System.Collections.ArrayList")
=> #<WIN32OLE:0x5f41780>
irb(main):003:0> lst.add('foo')
=> 0
irb(main):004:0> lst.add('bar')
=> 1
irb(main):005:0> lst.add('baz')
=> 2
irb(main):006:0> lst.Count
=> 3
irb(main):007:0> lst.Item(0)
=> "foo"
irb(main):008:0> lst.Item(1)
=> "bar"
irb(main):009:0> lst.Item(2)
=> "baz"
sans rubyclr. Maybe there's a problem with your DLL or its
COM-enabledness? Of course I just might have stumbled on a
System.Collections.ArrayList that is pre-.NET - I'm not too COM-savvy.
David Vallner