   Problem with HID device in DirectInput
  Hello all,I'm trying to detect plugging and unplugging of HID devices. I have registered device notifications using RegisterDeviceNotification(). The notification message arrives OK, but IDirectInput::FindDevice() always fails with DIERR_DEVICENOTREG.In the message loop I have something like this:case WM_DEVICECHANGE :    if (wParam == DBT_DEVICEARRIVAL) {   DEV_BROADCAST_DEVICEINTERFACE *pBDI = (DEV_BROADCAST_DEVICEINTERFACE*)lParam;   if (pBDI->dbcc_devicetype == DBT_DEVTYP_DEVICEINTERFACE) {  HRESULT r = m_pDirectInput->FindDevice(pBDI->dbcc_classguid, pBDI->dbcc_name, &guid);  // !!! Always getting DIERR_DEVICENOTREG here !!!   }    }    break;dbcc_classguid contains {4d1e55b2-f16f-11cf-88cb-001111000030} (which should be GUID for HID class) and dbcc_name contains something like \\?\HID#Vid_046d&Pid_c21a#7&7a3c6c4&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}Thanks for any help,Petr   