Questions tagged [rubydl]

7 questions
6
votes
8 answers

How can I write a generic C function for calling a Win32 function?

To allow access to the Win32 API from a scripting language (written in C), I would like to write a function such as the following: void Call(LPCSTR DllName, LPCSTR FunctionName, LPSTR ReturnValue, USHORT ArgumentCount, LPSTR Arguments[]) which…
Matthew Murdoch
  • 30,874
  • 30
  • 96
  • 127
4
votes
2 answers

I am familiar with Ruby /DL but not sure how to use the C function calls that have pointers for return parameters

I have this function in this Module require 'dl' require 'dl/import' module LibCalendars extend DL::Importer dlload './cal2jd.o' extern 'int iauCal2jd(int, int, int, double *, double *)' end How do I set this up in a Module to get access to…
Douglas G. Allen
  • 2,203
  • 21
  • 20
3
votes
3 answers

How do you use Ruby/DL? Is this right?

I am trying to write an interface between RSPEC (ruby flavoured BDD) and a Windows application. The application itself is written in an obscure language, but it has a C API to provide access. I've gone with Ruby/DL but am having difficulties…
Brett
  • 129
  • 2
  • 10
2
votes
1 answer

No sound. Uses Ruby and winmm through RubyDL

Expected behavior: middle C played on one midi instrunment, then another. Actual behavior: a DL deprecation warning and no sound. Running Windows 7. The code: require "dl/import" class LiveMIDI ON = 0x90 OFF =0x80 PC = 0xc0 def…
Fluffy Ribbit
  • 316
  • 1
  • 4
  • 15
1
vote
0 answers

Undefined Method With DL::Importer

The debugger states that the method message is undefined is it becuase it is nested in C and if so how do i change this class LiveMIDI module C extend DL::Importer dlload…
0
votes
3 answers

How do you return a variable in a C -> ruby interface?

A follow up to an earlier question, showing the part that fails when I try to get the error message from my target library: require 'gt4r' @@test_environment = "INCLUDE=C:\\graphtalk\\env\\aiadev\\config\\aiadev.ini" @@normal_user =…
Brett
  • 129
  • 2
  • 10
0
votes
1 answer

Segfault when calling OpenProcessToken via Ruby/DL

Please see the update below I have been attempting to fix a Ruby library's ability to communicate with another program across UAC contexts and need to create a shared file map with the same security attributes as the current user. I'm using Ruby/dl…
Chris Hunt
  • 3,840
  • 3
  • 30
  • 46