Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WinNT serial communication

0 views
Skip to first unread message

Andre Summer

unread,
Apr 22, 2000, 3:00:00 AM4/22/00
to
Hello,
I have written a program under C++-Builder with inportx and outportx
(works under Win9.x). I am very satisfied with this commands because I can
directly write in the registers of the UART and so it is very fexibel. But
Windows NT denies the access on the serial port. How professionals do solve
this problem?


Brett Wilson

unread,
Apr 22, 2000, 3:00:00 AM4/22/00
to
Use CreateFile("COM1",...) and then use ReadFile and WriteFile to access
it like a normal file. Use some fns like GetCommConfig to configure the
speed, etc.

Brett

Rich Webb

unread,
Apr 22, 2000, 3:00:00 AM4/22/00
to
On Sat, 22 Apr 2000 21:41:42 +0200, "Andre Summer" <andre....@vol.at>
wrote:

Let somebody else handle the serial port component:

TComThread (freeware)
http://www.protogene.com/people/giles/builder.html

TSerialPort (commercial, low cost)
http://www.accent-tek.com


--
Rich Webb Norfolk, VA
raw...@erols.com

Jerry Bloomfield (TeamB)

unread,
Apr 23, 2000, 3:00:00 AM4/23/00
to
On Sat, 22 Apr 2000 21:41:42 +0200, "Andre Summer" <andre....@vol.at>
wrote:

>Windows NT denies the access on the serial port. How professionals do solve
>this problem?

Well, you can write a device driver to give you access to the serial port,
or you can use the MS-prescribed "ReadFile()/WriteFile() solutions. You
could also purchase a third-party component to give you this access
yourself...

Jerry Bloomfield (TeamB)
--
http://www.teamb.com Jers...@wwa.com
Please do *NOT* send private e-mail without prior permission (my anti-spam
filters will probably just delete it anyway <g>)

Jonathan Arnold

unread,
Apr 24, 2000, 3:00:00 AM4/24/00
to
> I have written a program under C++-Builder with inportx and outportx
> (works under Win9.x). I am very satisfied with this commands because I can
> directly write in the registers of the UART and so it is very fexibel. But
> Windows NT denies the access on the serial port. How professionals do solve
> this problem?

You can't use inport / outport any more. Win32 is more "protected"
than that, so it isn't allowed.

However, you do have a few different options, as have been posted here
before:

Discussion of Port I/O under NT:
http://users.skynet.be/k-net/ParPort/index.html
http://www.bcbdev.com/faqs/faq30.htm

> Harold Howe has contributed something that you might be able to use
> under win95 only:
> http://www.bcbdev.com/components.htm

Or EnTech's Port I/O component:
http://www.entechtaiwan.com/tools.htm

Or, for Win9x only, if you have TASM, you can use the following:

#define outportb(port,val) outb(val,port)

void __fastcall outb(Byte val, WORD port)
{
asm out dx,al
}

#define inportb(port) inb(0,port)

Byte __fastcall inb(Byte dummy, WORD port)
{
asm in al,dx
}

There's also a great site on programming the parallel port:

http://www.lvr.com/parport.htm

+====================================================+
| Jonathan Arnold (mailto:jdar...@buddydog.org) |
| Havas Interactive HyperStudio Engineer |
| http://www.buddydog.org http://www.hyperstudio.com |
+====================================================+

Outside of a dog, a book is man's best friend. Inside
of a dog, it's too dark to read. -- Groucho Marx

David Piontek

unread,
May 4, 2000, 3:00:00 AM5/4/00
to
There's an excellent tutorial on how to go about doing exactly this at
http://www.traverse.com/people/poinsett/bcbcomm.html

Andre Summer wrote:

> Hello,

0 new messages