By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,290 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,290 IT Pros & Developers. It's quick & easy.

COM, LPT and USB to C, C++ Interface.

P: n/a
hi, I didn't write programs for more then 20 years. So I got some
truble wenn I started again.
Can somebody help me ?

How do I interface a COM, LPT oder USB I/O with C, C++.
Thank you very much.
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a

These all have separate answers. And, if you are interested in C/C++, you
posted in the wrong newsgroup (this is a Visual Studio .NET newsgroup).

Serial communications uses either a serial comms add-on (there are lots of
these around, many of them free). For example, downloads from my homepage,
and code in my book (below)

Parallel comms requires a device driver. I have a .NET control that wraps
such a driver on my homepage (see IONet).

Here is my USB FAQ:
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 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 to order.
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.