mikeobrien/HidLibrary

HidReport Data Length is Read-Only? WIN 10 Issue?

nobbyv opened this issue · 0 comments

I saw a few people had issues with writing using this library on WIN10. I'm using CreateReport to create a HID report, but the length of the data array always comes back as 0, and attempting to set it gives an error in Visual Studio. Anyone else experiencing this?

    Public Function HidDeviceReboot()

    If Not MMM_TS_HID_Device.IsOpen Then
        MMM_TS_HID_Device.OpenDevice()
    End If

    Dim RebootCMD As HidReport = MMM_TS_HID_Device.CreateReport
    RebootCMD.Data.Length = 8 'Compiler complains here

    RebootCMD.ReportId = 3
    RebootCMD.Data(0) = 3
    RebootCMD.Data(1) = 7
    RebootCMD.Data(2) = 5

    MMM_TS_HID_Device.WriteReport(RebootCMD)

    Return 1

End Function