auto featureReport = hidDevice->CreateFeatureReport(6); auto dataWriter = ref new DataWriter();
Array<UINT8>^buff = ref new Array<UINT8>(6);
buff[0] = (uint8)featureReport->Id;
buff[1] = 0xe;//update mode
buff[2] = 0;
buff[3] = 0;
buff[4] = 0;
buff[5] = 0;
dataWriter->WriteBytes(buff);
featureReport->Data = dataWriter->DetachBuffer();
create_task(hidDevice->SendFeatureReportAsync(featureReport))
.then([this](task<uint32> bytesWrittenTask)
{
auto x = bytesWrittenTask.get(); // If exception occured, let an exception flow down the task chain so it can be caught
//MessageDialog^ msg = ref new MessageDialog(x.ToString());
});
This code is to access the hid driver after the success of the need to send commands to the hid device, but here the error featureReport-> Data = dataWriter-> DetachBuffer (); Error Message: HRESULT: 0x80070057 Parameter Error