Hi,
----- Original Message ----- 
From: "Dave Burt" <dave / burt.id.au>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Monday, May 30, 2005 9:40 PM
Subject: Re: WIN32API


>
> "Wolfgang" <wollez / gmx.net> 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