Hello,
I'm trying to find a way to write code that will display an input report in my application when the USB device has one ready to send. I am using HID drivers.
I am using VS2005 and started off with Jan Axelson's Visual C++ HID USB application.
So far I am using the code below which uses a button that the user clicks to activate. While this is running the application becomes mostly unusable though (busy reading input reports), it looks for reports even when there are none available, and preferably there would not need to be a button click at all. The user would open the program and from then on, if the device has an input report ready, it displays it to the user.
My current code for "accomplishing" this:
void CUsbhidiocDlg::OnBnClickedcontrx()
{
//Try defining new receive function that polls only the input reports
ReadInputReport();
//Enable the timer to cause periodic exchange of reports.
//The second parameter is the number of milliseconds between report requests.
SetTimer(ID_CLOCK_TIMER, 10000, NULL);
}
Thanks for any and all help!