注册 登录
编程论坛 C++ Builder

usbopen,,怎么找不到我的键盘USB KEYBOARD

LD_BCB_2018 发布于 2018-09-22 12:05, 2739 次点击
       有哪位高人可以指点一下,谢谢!

  usb_init();
  usb_find_busses();
  usb_busses=usb_get_busses();
  usb_find_devices();
  for(bus=usb_busses; bus; bus=bus->next){
    for(dev=bus->devices; dev; dev=dev->next){
      if(dev->descriptor.idVendor == USBDEV_VENDOR1 && dev->descriptor.idProduct == USBDEV_PRODUCT1)
          {
        MessageDlg("yang2 USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);

      break;
          }
    }
    if(dev)
        {
        MessageDlg("yang2b USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
      break;
        }

                   MessageDlg("yang888b USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
   
  }



  
  if(!dev)
  for(bus=usb_busses; bus; bus=bus->next){
    for(dev=bus->devices; dev; dev=dev->next){
      if(dev->descriptor.idVendor == USBDEV_VENDOR && dev->descriptor.idProduct == USBDEV_PRODUCT)
          {
          MessageDlg("yang3 USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);

      
      break;
          }
    }
    if(dev)
        {
        MessageDlg("yang3b USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
      break;
        }

    MessageDlg("yang999b USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
   
  }

     DEV 返回值没有,找不到对应的USB HID
0 回复
1