Please rephrase. Don't understand.
Please rephrase. Don't understand.
sorry, because my english is not good..i can connect this project with USB,but when i open this project ,my computer can't run.
please help me!!
caodungviet (28th April 2011), Gamer (12th October 2013)
sorry but i can't understand how you can search HID_CLASSGUID {0x6bdd1fc6, 0x810f, 0x11d0,{ 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f }},.everytime i have searched and i allway search "{a5dcbf10-6530-11d2-901f-00c04fb951ed}" with the another USB.
please help me!! thanks
Please give me the directions by images!!
I don't understand your question. This example is made for HID devices, a5dcbf10-6530-11d2-901f-00c04fb951ed is USB raw device ?
sorry, i wrong. However how can you find PID and VID of a USB HID?? please help me!!
Use SetupDi API
Hi there
I'm a newbie in c++ programming, I'm doing my thesis and stealing code from here and there.... So thanks for the example first!
I noted that the ReadThread is actually eating one CPU because it's in an endless loop, checking for events. I added a sleep statement that lets it run once per second and CPU usage dropped dramatically. Of course you lose responsiveness and you get a notification a second after the device is plugged in, but I don't think it's a major drawback.
EDIT: My bad, I'm looking from the perspective of my device (a thermometer) that really doesn't run in realtime. Following joystick movement requires more frequent updates. Still some delay of 0.01sec won't be noticeable and should reduce CPU usage too.
Last edited by bigblondewolf; 4th August 2011 at 19:20.
Hi, all!
First of all I want to tell "Thanks" for this example!
Now I write project for using Magnetic Stripe Reader that recognized by Windows as USB HID Device:
But in this example it always return INVALID_HANDLE_VALUE in usbexample.cpp:273 on:Qt Code:
##?#HID#VID_1136&PID_3003#6&2b575f1c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}To copy to clipboard, switch view to plain text mode
And DevicePath is correct:Qt Code:
ReadHandle = CreateFile((DetailedInterfaceDataStructure->DevicePath), GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);To copy to clipboard, switch view to plain text mode
returnQt Code:
To copy to clipboard, switch view to plain text mode
Qt Code:
\\?\hid#vid_1136&pid_3003#6&2b575f1c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}To copy to clipboard, switch view to plain text mode
What's wrong?
Last edited by stringer; 21st December 2011 at 15:35.
Hi stringer,
try following code might it help's you.
Qt Code:
HANDLE hFile = CreateFile( DetailedInterfaceDataStructure->DevicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );To copy to clipboard, switch view to plain text mode
Thanks for quick reply!
But nope!
Added after 32 minutes:
When I call GetLastError() after CreateFile, I get number 5. Google tell me that this is ERROR_ACCESS_DENIED. Why?
My System is Windows 7 x64 with disabled UAC.
Last edited by stringer; 21st December 2011 at 15:16.
Assignment of WriteHandle goes well, but ReadHandle generate error ERROR_ACCESS_DENIED.
Maybe, for my task, use RAW Input Devices like here: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx ?
But I don't know how. Can anybody help me?
i am trying to develop qt application using USB to control relay board..... I was trying this windows USB Example...
always getting an error message " :: error: No rule to make target `../../qt/2010.05/qt/mkspecs/win32-g++/qmake.conf', needed by `makefile'. Stop." Can anyone please give suggestion how to recover from this error.........Is there any sample application available using USB in windows.....
please reply to my post......can any one help me to overcome this problem.....
Please help me regarding this !!!!!!!!!!!!!... i have entered correct VID & PID for the device but this application is not showing the device connected......
i tried to connect USB relay board which uses Microchip Pic 18 series.... I want to control those relays through USB......
My device is getting connected with this app....... now the proble is that, wen am creating file ReadHandle and WriteHandle bot are getting value 0xffffffff...... i tried by changing the values but no use..... when i tried to display device path its showing correct only...... CreateFile function always returns 0xffffffff only..............
Hello, I am using this example and it seems to be recognizing my HID device just fine in the checkUSB(),
but, in the winEvent I am getting wParam = 7 all the time, both when I connect or disconnect the device, so it doesn't catch these events:
DBT_DEVICEARRIVAL = 0x8000 and DBT_DEVICEREMOVECOMPLETE = 0x8004.
any ideas?
Thanks
Try to use this libraries and demos: microchip.comMy device is getting connected with this app....... now the proble is that, wen am creating file ReadHandle and WriteHandle bot are getting value 0xffffffff...... i tried by changing the values but no use..... when i tried to display device path its showing correct only...... CreateFile function always returns 0xffffffff only..............
Added after 6 minutes:
Try to add this line into .pro file:
Qt Code:
DEFINES += _WIN32_WINNT=0x0501To copy to clipboard, switch view to plain text mode
Last edited by stringer; 9th February 2012 at 19:22.
galrub (9th February 2012)
Bookmarks