Newbie Question: Ruby/DL Parameters


#1

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.