0

I am working in a UWP app project. When I try to use Windows::Gaming::Input::Gamepad::Gamepads->Size to get the number of connected gamepads, it returned 0 (I connected Xbox One Controller and it play game fine). Then I try plug out and plug in my Xbox One Controller, I got this log in Debug output of VS2019.

onecoreuap\xbox\devices\api\winrt\pnpdevice.cpp(506)\Windows.Gaming.Input.dll!0EF71146: (caller: 0EF73A5C) ReturnHr(3) tid(29f4) 80070057 The parameter is incorrect.
onecore\com\combase\dcomrem\preventrundownbias.cpp(1310)\combase.dll!75F8752A: (caller: 75F8738B) LogHr(1) tid(4300) 80070005 Access is denied.

How can I fix this?

cakcak
  • 1
  • 1
    Will the `Gamepad.GamepadAdded Event` and `Gamepad.GamepadRemoved Event` be triggered when you plug out and plug in your gamepad? – Roy Li - MSFT Sep 27 '22 at 06:26
  • Try running [this sample](https://github.com/microsoft/Xbox-ATG-Samples/tree/main/UWPSamples/System/GamepadUWP) on your system to see if it works. You should also make sure you have all pending Windows Updates installed. – Chuck Walbourn Sep 27 '22 at 19:44

0 Answers0