From: warhero Date: 2006-12-04T14:55:07+09:00 Subject: utilizing dlls in windows programming? This is a two part question: I have been reading the pick-axe book and was reading the chapter on ruby and windows. I was reading documentation on the DL library. (is library the correct term for that?), but my question: what is the difference in the Win32API and using say DL.dlopen? Also in reading the documentation on the Win32API in the back of the book, it said that Win32API is more than likely going to be phased out. My second question: I am trying to utilize a DLL that is for phidgets (phidgets.com). They have a dll (phidget21.dll) that is supposed to be used to gain access to controlling their hardware. I've looked at their documentation for the C language. Is that usually what a dll is written in? C? You can download what I am looking at from the documentation section. (The C API Manual ). I've tried a couple of different ways to try and use the dll. Nothing as succeeded. I've tried the Win32API and the DL.dlopen. It's probably just the way i'm trying to use it. here is what im trying: require "dl" Phidget21 = DL.dlopen("phidget21"); f = Phidget21["CPhidgetRFID_create", "S"] handle = f.call() open = Phidget21["CPhidget_open", "II"] open.call( 25807 ) The first problem is that handle = nil. Besides that, I don't understand fully how to be passing back and forth parameters to the dlls. This example cause the interactive ruby to crash (terminates in an unusual way). I know this isn't all that's needed to work with the phidgets, but i'm just trying to go step by step and even get it setup correctly. download the phidget21.dll (http://www.smithaaronlee.net/downloads/phidget21.dll), i've posted the dll online. Also, here is a direct link to the C API :http://www.phidgets.com/documentation/C_API_Manual_Phidget21.pdf any help, hints or tips would be much appreciated. thanks