Skip to content

Converting to HANDLE from hid_device #463

@NefariousTechSupport

Description

@NefariousTechSupport

Is there any way to convert from type hid_device to type HANDLE, I'm having issues with with hid_write() so have decided to use HidD_SetOutputReport(), which requests a variable of type HANDLE, which hid_device is incompatible with. I'm just wondering if there is a way to convert from hid_device to HANDLE.

void Write(hid_device* handle, unsigned char buf[0x21])  //handle is assigned in main(), yes it is done properly, you can read data however it isn't useful unless it is polled due to the devices protocol
{
	if (HidD_SetOutputReport(handle, buf, 0x21))             //Returns with false
	{
		cout << "write succeeded";
	}
	else
	{
		cout << "failed with code: " << GetLastError();    //Returns "failed with code: 6" which means invalid handle.
	}
}

Thanks in advance!

PS: if my tone seems annoyed, I'm just tired, so pardon that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions