参考代码应该是这样的吧。没有遇见过,看看接一个设备有没有这样的问题?!
Example
// Look for a device having VID = 0547, PID = 1002
USBDevice = new CCyUSBDevice(Handle); // Create an instance of CCyUSBDevice
int devices = USBDevice->DeviceCount();
int vID, pID;
int d = 0;
do {
USBDevice->Open(d); // Open automatically calls Close() if necessary
vID = USBDevice->VendorID;
pID = USBDevice->ProductID;
d++;
} while ((d < devices ) && (vID != 0x0547) && (pID != 0x1002));
|