473,382 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Talking to USB

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.
Nov 21 '05 #1
6 3600
ph**********@yahoo.com (Don) wrote in news:41a74d72.8530337
@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.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #2
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.
Nov 21 '05 #3

"Don" <ph**********@yahoo.com> wrote in message
news:41**************@news.individual.net...
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
Nov 21 '05 #4
Don
On Fri, 26 Nov 2004 17:53:31 GMT, Lucas Tam <RE********@rogers.com>
wrote:
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.


Sorry! Will do.

Don.
Nov 21 '05 #5
Don
On Fri, 26 Nov 2004 10:07:51 -0800, "Marc Reinig"
<Ma***@newsgroups.nospam> wrote:
"Don" <ph**********@yahoo.com> wrote in message
news:41**************@news.individual.net...
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.


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

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

Don.

On Fri, 26 Nov 2004 11:08:24 -0700, "Dick Grier"
<di**************@msn.com> wrote:
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.


Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jane Austine | last post by:
I need to control a command line program via python. I first tried popen2 and 3 but I couldn't find a way to talk to the subprocess interactively; that is, read some and then write some, and...
10
by: robbie carlton | last post by:
I understand that c was originally designed to write and communicate with the unix operating system. Until recently I ignored this, as I was mostly polaying with opengl. I am now interested in...
11
by: seattleboatguy | last post by:
I am trying to send a message from a visual c++ user-thread to the main window, so the main window can update text on the window to reflect what the user-thread is doing. I have tried 2 different...
2
by: Simon T. | last post by:
Hello All, I am new to C# and the .NET framework, so please forgive and pity me if the question and understand reveals massive ignorance. I am trying to get SerialPort talking to a "Standard...
3
by: pamelafluente | last post by:
I am new to asp.net. I have an asp page with a submit button which sends out some information. Instead of having IIS to respond and deal with this information, I would like to have a .NET...
1
by: Daniel | last post by:
what is best way to talk to https webpages within .net? any good librarys for talking to https websites?
20
by: raylopez99 | last post by:
Dvorak is always interesting, albeit speculative. What hidden gem has he found in Vista that helps developers? It can't be .NET/CLI, that's been out forever. RL Vista rollout hides reality...
1
by: Pumpkin Carver | last post by:
I have a form that has a listview on it and a serious of strings in the listiew. When i doubel click on the listview item it opens a new form and displays the text that i pass to the constructor....
20
by: Steven D'Aprano | last post by:
Am I the only one who finds that I'm writing more documentation than code? I recently needed to write a function to generate a rank table from a list. That is, a list of ranks, where the rank of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.