Forum: Ruby Newbie Question: Ruby/DL Parameters

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Chris W. (Guest)
on 2007-03-11 01:06

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*)"

  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.

This topic is locked and can not be replied to.