Jump to content

Recommended Posts

Posted

I need help in communicating to the following dll.

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.

How do I code it?

What do I do for the hex value and for the integer array?

Steven

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...