Win32API or DL library usage?
-
In the context of SU8, with Ruby 1.8.6, i386-mswin32:
Has anyone got any tips on using the Win32API library? Or, since Win32API is deprecated, preferably the DL library?
I get errors when trying to
require 'dl'
or
require 'Win32API'
.
At a minimum, I presume I would have to have a local version of Ruby 1.8.6 installed to point to these libraries just to load them. Anyone have some references that shows how this might be loaded and usage examples? TIA.
-
Well you have to copy the win32API.so to plugins, or requre it by full path.
-
I was able to get things working with Win32API.
However, the DL library usage is so poorly documented that I couldn't get it working. The example given in http://forums.sketchucation.com/viewtopic.php?f=180&t=16574 by CPhillips seems incomplete.
-
@david. said:
The example given in http://forums.sketchucation.com/viewtopic.php?f=180&t=16574 by CPhillips seems incomplete.
He has an error in the example, which was noted further down the thread.
You have to type the DLL functions as they are casewise (in C) in the
extern
call, but then the DL library creates a "Rubyish" method that has the first char downcased. -
OK, got DL working. I misunderstood the comment about case. Thanks!
-
@david. said:
However, the DL library usage is so poorly documented that I couldn't get it working.
The doc for DL is located in the source package, at:
ruby-1.8.6-p287\ext\dl\doc\dl.txt
Here's a copy so you need not download the whole source package:
dl.txt
Online version at ruby-doc.org -
-
Helper script: Ruby LOAD PATHs script (Win32) : ver 3.0.1
-
Topic: Win32API vs DL lib
Advertisement