From: Mike Woodhouse Date: 2007-08-29T22:30:03+09:00 Subject: Re: Calling VB6 dll from Ruby On Aug 29, 2:06 pm, "lrleb...@gmail.com" wrote: > I am trying to use a VB6 dll created by another programmer from Ruby. > To see what was I opened it in Visual Studio's object browser. It has > a series of classes with their methods and properties. I want to acess > the Load method in the SalesContract class. Here's my code (which is > probably wrong) > > require 'Win32API' > @ops = Win32API.new('SMD Client.dll','SalesContract::Load','I','P') > > Here's the error message I'm getting > > C:/Data/Projects/Smd_Ruby/testdll.rb:2:in `initialize': > GetProcAddress: SalesContract::Load or SalesContract::LoadA > (RuntimeError) > from C:/Data/Projects/Smd_Ruby/testdll.rb:2:in `new' > from C:/Data/Projects/Smd_Ruby/testdll.rb:2 > I haven't tried this from Ruby, but VB6 DLLs are actually "ActiveX" or COM DLLs, so you should probably be trying to talk to them using the Win32OLE library. HTH, Mike