Re: USB-devices.
- From: Siegfried <siegfried@xxxxxxx>
- Date: Sun, 12 Feb 2006 00:14:04 +0100
Well, The device is home-built, using Freeware drivers at the moment, because I don't know how to use HID drivers.
The device uses a PIC18 chip to cummunicate to the computer, which probably is totaly not relevant here, so :D
I have a C++ program that can comunicate with the device, but, since I cant realy program much C, I would like to use VB instead.
To the point:
Whats the API's for HID devices then?
Hi,.
You normally use whatever API is required for the specific hardware device that is attached to the USB port. There is no general-purpose driver for this. So, if you are connecting to a serial device, you use the Windows serial APIs. If a sound device, you use the MCI APIs. If a disk drive, you use the various file APIs. The actual driver that is installed when Windows detects the USB device translates these Windows APIs to the device specific commands required for the actual hardware.
However, if you have custom built USB hardware, you need lower level access to the device. You must know A LOT about the hardware before this sort of thing is useful. I suggest that you get a copy of Jan Axelson's book, USB Complete, 3nd Edition. You can get information on it from the Books link on my homepage.
If you just want to use a USB serial port adapter to connect to an RS-232 device, then you may use MSComm or any of the other serial communications methods that are described in detail in my book.
Some USB devices act as HID keyboard devices. With these devices data is sent to a text window (such as a TextBox) just as though it had been typed at the keyboard. You may be able to set the input focus to a textbox and interpret the data in the KeyPress event. A more satisfactory mechanism that some devices, though only a small subset, support is/are the HID APIs -- these may work without focus being set to a textbox. Only the device manufacturer's information will reveal these operations; there is no universal standard.
***
- Follow-Ups:
- Re: USB-devices.
- From: Marc Reinig
- Re: USB-devices.
- From: *** Grier
- Re: USB-devices.
- From: Michael C
- Re: USB-devices.
- References:
- USB-devices.
- From: Siegfried
- Re: USB-devices.
- From: *** Grier
- USB-devices.
- Prev by Date: Re: System Wide Hook to Center Dialog Windows - Help
- Next by Date: Re: System Wide Hook to Center Dialog Windows - Help
- Previous by thread: Re: USB-devices.
- Next by thread: Re: USB-devices.
- Index(es):