Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting to HANDLE from hid_device #463

Open
NefariousTechSupport opened this issue Oct 23, 2020 · 1 comment
Open

Converting to HANDLE from hid_device #463

NefariousTechSupport opened this issue Oct 23, 2020 · 1 comment

Comments

@NefariousTechSupport
Copy link

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.

@Youw
Copy link

Youw commented Oct 23, 2020

Please see #373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants