• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

Get list of HID devices without using deviceBox

Started by peterviau, September 23, 2009, 07:02:21 pm

Previous topic - Next topic

peterviau

Is it possible to get a list of HID devices and select one using c# without using DeviceBox?

Roman Novgorodov

Hello

You can use following properties for access to device list:

nrHid1[i] - devices from device list
nrHid1.DeviceCount - device list length
nrHid1.DeviceIndex - index of selected (active) device
nrHid1.HidDevice - active device (same as: (NrHidDevice)nrHid1[nrHid1.DeviceIndex])


The following code choices second device:


nrHid1.DeviceIndex = 1; // zero based index


Roman Novgordov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

ChrBlack

Quote from: Roman Novgorodov on September 25, 2009, 12:10:55 am
Hello

You can use following properties for access to device list:

nrHid1[i] - devices from device list
nrHid1.DeviceCount - device list length
nrHid1.DeviceIndex - index of selected (active) device
nrHid1.HidDevice - active device (same as: (NrHidDevice)nrHid1[nrHid1.DeviceIndex])


The following code choices second device:


nrHid1.DeviceIndex = 1; // zero based index


Roman Novgordov



I had the same idea before that qestion. I've tried it without nrDeviceBox and nrHid1.DeviceIndex returns zero. It seems that nrDeviceBox have to be on form and have to be assigned with nrHid1 (set nrDeviceBox1.nrComm property to nrHid1). I have a sense that nrDeviceBox do some enumerating thing.