Reading from a USB port with Win32 API
-
I have a HID device (magnetic cardreader) that uses a usb port to connect to a computer running any version of windows. I want to be able to figure out what port the device is on and read information from it. I know I need to use the Win32 API, but I haven't been able to find any useful information on how to do this. Can any one help? Thanks in advance.
-
I have a HID device (magnetic cardreader) that uses a usb port to connect to a computer running any version of windows. I want to be able to figure out what port the device is on and read information from it. I know I need to use the Win32 API, but I haven't been able to find any useful information on how to do this. Can any one help? Thanks in advance.
I would start by looking at the work Camilo Toro has done. He has wrapped the needed portions of Win32 in a C# class. You'll be able to do what you want without writing much code at all. His work, called USBSharp, can be found on Jan Axelson's HID Page[^]. (Jan is the author of USB Complete, a great book to wet your taste buds.) For more details, look at the rest of Jan's site, the MS DDK, and MSDN of course. Hope this helps, Chris
-
I would start by looking at the work Camilo Toro has done. He has wrapped the needed portions of Win32 in a C# class. You'll be able to do what you want without writing much code at all. His work, called USBSharp, can be found on Jan Axelson's HID Page[^]. (Jan is the author of USB Complete, a great book to wet your taste buds.) For more details, look at the rest of Jan's site, the MS DDK, and MSDN of course. Hope this helps, Chris
Thanks for the link. I could have used that a few years ago when I was trying to have 2 independent usb mice... John