[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

"int cfunc(void) " how can I call this function with "ruby/dl'

bbmerong

1/17/2008 4:37:00 AM


In ruby/dl (win32)

I define the function like the belows.

------------------------

require 'dl'
libc=DL.open("libfunc.dll")
func=libc['func_test','IO'] # int func_test(void);


-------------------------
Then, I typed in irb like the belows.

func.call()

But the error message is displayed

'1 arguments are need'

So, I type in irb like this

func.call(nil)

But, the error message is also displayed.

'DL::DLTypeError: unknown type '0' of the return value.'

I'm not sure how to call this function in ruby/dl

Please let me know the reason and solutions.

Thank you in advance.