Re: Writing to Serial Port
From: Øyvind Hansen (oyvind_at_scantrol.no)
Date: 03/01/05
- Next message: Jonathan Wood: "Re: Header File Madness"
- Previous message: ckokotay: "Tab Control Problems - Controls not visible in resource editor"
- In reply to: Scott McPhillips [MVP]: "Re: Writing to Serial Port"
- Next in thread: Joseph M. Newcomer: "Re: Writing to Serial Port"
- Reply: Joseph M. Newcomer: "Re: Writing to Serial Port"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Mar 2005 17:47:25 +0100
In other words it is not necessary to Wait forSingleObject() when using
ovelapped I/O.
I can run WriteFile() and allow my program to run without waiting for the
data being transmitted?
Oyvind
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> skrev i melding
news:eqG9gPmHFHA.3208@TK2MSFTNGP10.phx.gbl...
> Oyvind Hansen wrote:
> > For transm,itting data on a serialport i am opening the port for
overlapped
> > operation and I am using the WriteFile() function for writing to the
port.
> > This works well, however i found an example in "Visual C++ Bible" where
the
> > author is using WaitForSingleObject() before running
GetOverlappedResult()
> > and setting.offset of the OVERLAPPED structure. This will block the
> > transmittdata function, and I can not really see a good reason for why
doing
> > that. Appreciate if someone could explain this...
> >
>
> This is overlapped I/O. One reason for doing it is that it is necessary
> to use overlapped I/O with a serial port if one wants full duplex (send
> while receive) operation. Another (possible) reason for doing it is so
> the code can do something else (such as read from socket or file) while
> the WriteFile is in progress. It is not necessary to increment the
> .Offset member.
>
> --
> Scott McPhillips [VC++ MVP]
>
- Next message: Jonathan Wood: "Re: Header File Madness"
- Previous message: ckokotay: "Tab Control Problems - Controls not visible in resource editor"
- In reply to: Scott McPhillips [MVP]: "Re: Writing to Serial Port"
- Next in thread: Joseph M. Newcomer: "Re: Writing to Serial Port"
- Reply: Joseph M. Newcomer: "Re: Writing to Serial Port"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|