From: Tallak Tveide Date: 2010-01-26T20:33:18+09:00 Subject: Re: win32ole with COM method taking two out refs Masaki Suketa wrote: > Ooops, > > On Sat, Jan 23, 2010 at 07:15:21AM +0900, Masaki Suketa wrote: >> >> How about using WIN32OLE_VARIANT? >> >> items = WIN32OLE_VARIANT(null, WIN32OLE::VARIANT::VT_NULL) >> errors = WIN32OLE_VARIANT(null, WIN32OLE::VARIANT::VT_NULL) > > items = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_NULL) > errors = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_NULL) > > Regards, > Masaki Suketa Sorry - no help. The code now looks like this (without olegen): #!/usr/bin/env ruby require 'rubygems' require 'win32ole' opc_automation = WIN32OLE.new 'Opc.Automation' p opc_automation.GetOPCServers # ok opc_automation.connect 'Matrikon.OPC.Simulation', 'test.rb' groups = opc_automation.OPCGroups group = groups.add 'test_rb_group' items = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_NULL) errors = WIN32OLE_VARIANT.new(nil, WIN32OLE::VARIANT::VT_NULL) group.OPCItems.AddItems 1, ['', 'Random.Int1'], [0, 1], items, errors ["ArchestrA.FSGateway.1", "Matrikon.OPC.SiemensPLC.1", "ArchestrA.DASSIDirect.1", "Prosys.OPC.Simulation", "Matrikon.OPC.Simulation.1"] test.rb:28:in `method_missing': (in OLE method `AddItems': ) (WIN32OLERuntimeError) OLE error code:0 in HRESULT error code:0x80020005 Typekonflikt. from test.rb:28:in `
' -- Posted via http://www.ruby-forum.com/.