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

ReadFileEx on a serial COMn port

361 views
Skip to first unread message

Mark Williams

unread,
Dec 17, 1995, 3:00:00 AM12/17/95
to
Greetings and Happy Holidays,

Anyone out there have any luck getting ReadFileEx
to read in data from a serial COMn port?

Can't use ReadFile and CreateThread becuase our apps are
coded to the (excellent BTW) Galaxy portablility class libs.
And NT thread events and the Visix vevents do not coexist
very well (I tried an event tester using the multithreaded
comm sample sent with msvc 2.2 and indeed the eventing
got really hosed)

Thus I'm using ReadFileEx since the completion routine
will run (I believe) in the context of the (singular) Galaxy
thread thus precluding event problems (hopefully)

Problem I'm having is that the LPOVERLAPPED_COMPLETION_ROUTINE
is not being invoked. The OVERLAPPED structure is clear and is
global. ReadFileEx is returning TRUE (OK)

The only example of ReadFileEx I can find is in the PDC sample and
that is on a file.

Anyone ever use ReadFileEx on a COMn port? Clues appreciated.
(NB: I'm using NT v3.51 FR, msvc 2.2)

Thanks in advance, Mark

Peter Lohmann

unread,
Dec 19, 1995, 3:00:00 AM12/19/95
to

> Greetings and Happy Holidays,
>
> Anyone out there have any luck getting ReadFileEx
> to read in data from a serial COMn port?
>
> Can't use ReadFile and CreateThread becuase our apps are
> coded to the (excellent BTW) Galaxy portablility class libs.
> And NT thread events and the Visix vevents do not coexist
> very well (I tried an event tester using the multithreaded
> comm sample sent with msvc 2.2 and indeed the eventing
> got really hosed)
>
> Thus I'm using ReadFileEx since the completion routine
> will run (I believe) in the context of the (singular) Galaxy
> thread thus precluding event problems (hopefully)
>
> Problem I'm having is that the LPOVERLAPPED_COMPLETION_ROUTINE
> is not being invoked. The OVERLAPPED structure is clear and is
> global. ReadFileEx is returning TRUE (OK)

Is the calling thread in an alertable wait state?

This is from the Win32 online reference:

"If the function succeeds, and the file reading operation completes,
but the calling thread is not in an alertable wait state, the system
queues the completion routine call, holding the call until the calling
thread enters an alertable wait state..."

Good luck.


Peter Lohmann
peter....@sandiegoca.attgis.com
Software Engineer
AT&T Global Information Solutions
/* I speak only for myself. */

Stephen Estes

unread,
Dec 19, 1995, 3:00:00 AM12/19/95
to
In article <mwilliamD...@netcom.com>,
mwil...@netcom.com (Mark Williams) wrote:
:> Greetings and Happy Holidays,

:>
:> Anyone out there have any luck getting ReadFileEx
:> to read in data from a serial COMn port?
:>
:> [snip]

Yes, I read and write to the comm port using ReadFileEx and WriteFileEx. For
the completion routine to be invoked you need to go into a wait state. I use
SleepEx().

--
Stephen Estes
ses...@onramp.com

0 new messages