Help with DLL Call

Started by SHX, November 14, 2007, 01:14:41 PM

Previous topic - Next topic

SHX

I am trying to call a DLL with the following requirements
QuoteDWORD __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

#1
QuoteThe part that I have no idea is how to do an array of integer values.


see here: http://newlisp.org/CodePatterns.html#extending">http://newlisp.org/CodePatterns.html#extending



scroll down, where the tables are.



Lutz

SHX

#2
Thanks Lutz,



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