revised April 24th 2001, modification for Visual C++
revised April 29th 2001, correction of bugs that occured during reconnection
If you experience any problem using this software, please be
sure that you have the latest version. Check our web site www.tetraedre.com
for an updated version of the software.
Otherwise report any bug to the address above or check the FAQ
Each programmer knows that accessing the hardware ports of a computer
is getting more and more complicated. The software presented here intends
to ease the development of applications using the serial port (COM) on
computer running Windows 32-bits operating systems.
Allen Denver, from the Microsoft Windows Developer Support wrote one
of the only technical article describing in details how to use the serial
port under Win32. This article can be downloaded on Microsoft's web site.
A copy of this article can also be found here.
From that article, I've written two different software packages. One
for what I call "non-event-driven" applications. This means simple applications
like console applications,... The other package is intended to be used
in event-driven applications (see serial2).
All software and documentation described here can be downloaded directly
here : serial.zip
The ZIP file contains two Borland C++ project files (sertest.bpr
and sertest2.bpr). Simply open them, compile, run and enjoy !
Compilation with Microsoft Visual C+
The project was originally created to be compiled with the
Borland C++ Builder development environment. In order to permit compilation
with Microsoft's Visual C++, I've modified a little the source code. A
"#ifdef __BORLANDC__" has been inserted in the header part of the sertest.cpp
and sertest2.cpp files in order to skip some Borland's specific
Once you have read Allen Denver's article everything is getting
clear, so the source files provided here is simply auto-documented. I've
written clear software with a very simple example that should be sufficient
to understand well the software.
The following table given an overview of the functions the application
can use. As we see, these one are very simple and allow the writting of
small application that access the serial port.