At 01:52 PM 6/26/02 +0100, davidl marsh wrote:
>I am currently using a version of DEV-C++ in its C configuration to do some
>number crunching but I need to be able to send and recive data via com1 for
>Rx and com2 for Tx of the results. which libraries do I need to INCLUDE at
>the start of the program.
>
>most of the books I read state inputp(address,data) or outp(address,data).
>
>is thisn just a form for ANSI compilers I am running the BORLAND VERSION V4
>off the CD bloodshed software distribute.
>further I have included all the stated xxxx.h files at the top of the
>programme.
inputp() and outp() will not work on NT/2000/XP style machines, because
direct hardware access is a tremendous security hole.
What you want to do is open the com ports through OS calls. I did a Google
search for "win32 serial port programming". I had to slide down past the
first 9 or so results, but then I found this Win32 Programming FAQ:
http://www.iseran.com/Win32/FAQ/section0.html
Down in section 5 is stuff on hardware access. But I thought that there
might be other stuff of interest, so I gave the link to the primary FAQ
page. This page will not answer all of your questions itself, but will
tell you which functions to look up in the "online help system". Dev-C++
comes with some such help files, but anything that you can't find there,
you can almost always find the most up-to-date information in the first few
results of a Google search. Google indexes the Microsoft Developer Network
(MSDN) pretty well. One thing to keep in mind -- this stuff is OS
dependent, so it behaves differently (in the details) between
95/2000/XP/CE/etc. That means you need to make sure the help page you are
reading is for the right operating system, and the right version of the
operating system. Also, be sure to read the entire page -- very important
information is frequently down in the "Remarks" section.
-
_____________________________ /"\
Mac Reiter \ / ASCII Ribbon Campaign
Nomadics, Inc. X Against HTML Mail
re...@no... / \ (To join the campaign, simply use
this in your signature.)
|