From: Wolfgang Date: 2005-05-30T22:50:21+09:00 Subject: Re: WIN32API Thanks for your help, but it is still not running. I think the fault is in my Fortran code. Wolfgang Park Heesob wrote: > Hi, > ----- Original Message ----- > From: "Dave Burt" > Newsgroups: comp.lang.ruby > To: "ruby-talk ML" > Sent: Monday, May 30, 2005 9:40 PM > Subject: Re: WIN32API > > > >>"Wolfgang" wrote: >> >>>Hello Brian, >>> >>>up to now I only have this in ruby: >>> >>>require 'Win32API' >>>win = Win32API.new("dlltest.dll","DLL_WOOD",[],'L') >>>somevalues = win.call() >>>print somevalues >>> >>>the self made dll should return at the moment a fixed value (for >>>testing). >>>I tried this with an integer, than it works. As soon I define the >>>variable >>>in fortran as real, I get this nice numbers. >>> >>>Wolfgang >> >>Hi! >> >>The last parameter to Win32API.new is the type of the return value. If >>your >>DLL function returns a long integer, 'L' is correct. If you change the DLL >>so that the function returns a float or a double, you will have to change >>that last parameter to 'F' or 'D': >> > > As far as I know, You can't use 'F' or 'D' paramenter in Win32API. > > This should be work for you: > > require 'Win32API' > win = Win32API.new("dlltest.dll","DLL_WOOD",[],'L') > somevalues = [win.call()].pack("L").unpack("f")[0] > print somevalues > > Regards, > > Park Heesob > > > > > > > >