Talking to USB

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

Environment: VB6 under W98

I have a USB hardware device I wish to program directly. The original
software installed a low level driver and the hardware is both
registered and operational.

Now then, I'd like to have access to this device directly. In other
words, I'd like to enumerate all devices on the USB bus, pick the one
I want, and then communicate with it (send commands, get data, etc).

So, how does one go about talking to the USB? VB6/W98 combo doesn't
seem to have any dedicated USB routines.

What I need - I guess - is the USB equivalent of the MSComm control.
Is there such a thing as a "USB Control"? What's the canonical way of
talking to USB from VB?

I did google around a bit but couldn't find anything applicable. Most
sites and pages I came across seem to focus on actually writing a low
level USB driver.

Thanks!

Don.
 
(e-mail address removed) (Don) wrote in @news.individual.net:
Environment: VB6 under W98

Try one of the classic VB6 groups... this is a VB.NET group and VB.NET
doesn't have absolute memory access.
 
Don said:
Environment: VB6 under W98
What I need - I guess - is the USB equivalent of the MSComm control.
Is there such a thing as a "USB Control"? What's the canonical way of
talking to USB from VB?

You don't talk to a USB port the way you talk to a COM port. You talk to a
USB device that has been attached to the USB. To do that, you need to know
the class of the device and talk to it through the class/device driver.

Marc Reinig
System Solutions
 
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, 2nd 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.


--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 
You don't talk to a USB port the way you talk to a COM port. You talk to a
USB device that has been attached to the USB. To do that, you need to know
the class of the device and talk to it through the class/device driver.

Apparently this is the wrong group (sorry) so we'll continue in
microsoft.public.vb.controls.

Don.
 
We'll continue over in microsoft.public.vb.controls because this is
the wrong group (sorry, again).

Don.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top