settings for WaitCommEvent

Tech-Archive recommends: Fix windows errors by optimizing your registry



This is a 3 part question, all dealing with WaitCommEvent:

First:
My code calls SetCommMask, then WaitCommEvent. After WaitCommEvent has
finished, do I need to re-call SetCommMask, or are the values still set? I
found an example that called SetCommMask after WaitCommEvent completed, and
I'm curious if that is something I should or should not be doing.

Second:
Is there a way to specify a timeout for WaitCommEvent? Whenever my
application exits, WaitCommEvent returns with FALSE (which causes my code to
display an error) because there was not way to yank it out of its waiting
state.

Third:
There are times that I *know* data is there! I can call other functions
while WaitCommEvent is waiting for data, and they are able to pull in data
while WaitCommEvent just sits there waiting for God knows what.

I'd like the answer to all of these, but I'll take whatever others know.

Regards,
Joe


.



Relevant Pages

  • Re: Serial Communication Problem
    ... Always use timeouts for receive operation. ... Either SetCommMask or WaitCommEvent caused problems for me long time ago so I do not use them.(There is no need for them especially ... > CreateFile with overlap mode. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Thread blockiert Hauptprogramm
    ... Ansosnten ändert sich ... des Wartens auf WaitCommEvent _alle_ anderen Aufrufe dieser Schnitt- ... WaitForSingleObject das Triggern des Events mit SetCommMask ...
    (de.comp.lang.delphi.misc)
  • Re: settings for WaitCommEvent
    ... My code calls SetCommMask, then WaitCommEvent. ... while WaitCommEvent is waiting for data, and they are able to pull in data ... Chris Tacke, Embedded MVP ...
    (microsoft.public.pocketpc.developer)
  • Re: WaitCommEvent and ResetEvent for SerialPort
    ... Read the SDK documentation about those functions thoroughly. ... > WaitCommEvent is necessary or will it bite us? ... > then triggers us to receive more characters and low and behold the 1st ... > while (!waiting) ...
    (microsoft.public.win32.programmer.kernel)
  • Re: WaitCommEvent and ResetEvent for SerialPort
    ... WaitCommEvent is supposed to handle the signalling state of the ... actually waiting). ... You try to read these characters, but it timesout or something and you only ... > if (!GetOverlappedResult(m_PortHandle, &overlappedCommStatus, ...
    (microsoft.public.win32.programmer.kernel)