Help with DLL Call

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
SHX
Posts: 37
Joined: Fri Feb 16, 2007 11:06 pm

Help with DLL Call

Post by SHX »

I am trying to call a DLL with the following requirements
DWORD __stdcall EnumeratePIE(long VID, long *data, long &count)

Call EnumeratePIE() once, before doing anything else, to determine a list of available devices. For our uses, always pass our VID of 0x05F3 for the first parameter, so that only PI Engineering devices will be included in the list.

The count parameter MUST be long, not int, even though Borland defines these as having the same meaning. The value returned in this parameter is the number of devices, not the number of data values.

The long *data parameter should be an array of at least 100 long values. Since there are four values for each device, PIEHID will return information on up to 25 HID devices. Since this parameter is a pointer, one could also pass a pointer to an array of structures, each containing four named long values. The advantage of doing this would be that you then don't have to remember the index offset for each variable type. The four long values for each device are, in sequence: USB Product ID, HID Usage, HID Usage Page, and Handle. The "handle" is a number identifying the device to additional PIEHID calls that follow. Zero is a valid value, so don't confuse zero to mean "no device." This number has no meaning to the operating system; it is purely for internal use. Usage and Usage Page define whether the device is a mouse, keyboard, etc, according to the HID standard.
The part that I have no idea is how to do an array of integer values.

I would appreciate any help in how to communicate with this dll.

Steven

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

The part that I have no idea is how to do an array of integer values.
see here: http://newlisp.org/CodePatterns.html#extending

scroll down, where the tables are.

Lutz

SHX
Posts: 37
Joined: Fri Feb 16, 2007 11:06 pm

Post by SHX »

Thanks Lutz,

I didn't realize that there was stuff in the documentation.

Locked