From: Corey Lawson Date: 2006-04-13T00:54:58+09:00 Subject: Re: win32ole with COM method taking two out refs Post your VB code... On 4/7/06, Adam Gardiner wrote: > Hi, > > I've got a challenge with a COM API that has a method with the > signature: > > OpenApplication arg0, arg1, arg2, arg3, arg4 > where > arg0, arg1, arg2 are String IN paramters (VT_BSTR) > arg3, arg4 are Variant OUT parameters (VT_BYREF|VT_VARIANT) > > Arg3 and Arg4 are both objects returned by OpenApplication - in > particular, arg3 is a HsxServer object for getting (mostly useless) info > about the server, and arg4 is a HsvSession object needed for any useful > work. > > I know I need to retrieve the values of arg3 and arg4 after the call to > OpenApplication using WIN32OLE::ARGV - the problem I have is: What do I > pass as placeholders for arg3 and arg4 so that the call will succeed, > and win32ole will know the types on return? > > I've tried passing nil, which leads to a Type mismatch error. > I've tried passing Object.new, which allows the method to succeed and > returns WIN32OLE objects in ARGV[3] and ARGV[4]. However, these objects > have no associated type library information, so I then receive > "undefined method" errors if I try to call any methods on them. > > In VB, the example code defines variables for arg3 and arg4 that are of > types defined in the type library (HsxServer and HsvSession), i.e. > > Dim session as HsvSession > Dim server as HsxServer > > Is there any way to achieve the same thing in Ruby with win32ole? > > Many thanks, > > Adam > > -- > Posted via http://www.ruby-forum.com/. > >