[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Newbie Question: Ruby/DL Parameters

Chris Wiles

3/10/2007 11:07:00 PM

Hello,

I am trying to call a function within a WIN32 DLL.


The Function Prototype is published as:
short pm3s(char* name, unsigned short addr, unsigned short* units);


I coded this:

module Discover
extend DL::Importable
dlload "RPPM3DDI.DLL"
extern "short pm3s(char*, unsigned short, unsigned short*)"
end

s = "Monitor 3"
unit = 0
count = 0

res = Discover.pm3s(s, unit, count)


When executed, I get:

(eval):5: [BUG] Segmentation fault
ruby 1.8.5 (2006-12-25) [i386-mswin32]

I assume that I am not specifying the parameters correctly. Any ideas
or comments will be appreciated.

Thanks.

--
Posted via http://www.ruby-....