I am learning Ruby. Though Ruby is a neat and feature rich language it
suffers from lack of good and updated documentation and tutorials in
english.

For example, I am having a difficult time with WIN32API. I have the
following functions in a dll named testdl.dll

#ifndef TESTDLL													
#define TESTDLL extern "C" __declspec(dllimport)					
#endif

TESTDLL float  _stdcall AddNum(float a, int b);	
TESTDLL int    _stdcall MulNum(int a, int b);	

I have succesfully used WIN32API to access MulNum. But I am unable to
access AddNum. I do not know how to access float data type through
WIN32API. I have tried the following code which does not work.

require 'Win32API'
ReturnVal = Win32API.new("testdll", "AddNum", ['n', 'n'], 'f')
t1 = ReturnVal.Call(20.2,10)
print t1, "\n"
print t1.type(), "\n"

After executing the code :
t1 = 0 
t1.type = Fixnum 
The results are incorrect.

Can I use WIN32API to access any dll?


With best regards,
Srijit