Newbie Question: Ruby/DL Parameters

C

Chris Wiles

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,039
Messages
2,570,375
Members
47,020
Latest member
anuradha

Latest Threads

Top