Check the deleted article too:
I can't connect to a Bluetooth LE Device using c++ Win32 API
I can't connect to a Bluetooth LE Device using c++ Win32 API - Visual Studio 2019 (v142). A few years ago there was a working Example at MSDN, but today the code doesn't work anymore. https://gist.github.com/programmarchy/c9d02e22d58bfab3f8bb seems to be the new source, but same Problem. BluetoothGATTGetDescriptorValue always returns ERROR_INVALID_FUNCTION. BluetoothGATTGetDescriptors or BluetoothGATTGetServices are working as expected. Fullowing link has sadly been deleted: https://social.msdn.microsoft.com/Forums/en-US/bad452cb-4fc2-4a86-9b60-070b43577cc9/is-there-a-simple-example-desktop-programming-c-for-bluetooth-low-energy-devices?forum=wdk