WaitForSingleObject
From: Ertan EFE (ertanefe_at_hotmail.com)
Date: 04/29/04
- Next message: Darius: "driver book for beginners"
- Previous message: Richard Ward: "Re: SetThreadDesktop fails even if I try to associate it with current desktop"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 13:51:41 +0300
hi,
I use WaitForSingleOject API to wait for an event. Event is coming from
WaitCommEvent in Listener thread, I set the com mask SetCommMask API
EV_RXCHAR parameter.
ý use a loopback atapter that connectod to com1. I use WriteFile API, then
this action stops the waitin state of listener thread that waiting for
incoming data. then I Use the ReadFile APý functiýon to retrieve written
bytes. But when I read all contents from the file with ReadFile API,
WaitForSingleObject is not wait second times in listener loop.
why WaitForSingleObject can't wait and signaled while incoming buffer free..
but when I send only one char at a time then all logic completely executing
without error. RxChar event comes only one at a time. when I send the 2, 3,
4, vs. lenghted byte array EV_RXCHAR coming two times. at the first time
ReadFile Read All Contents of incoming buffer, second times read 0 bytes
from the file. since if EV_RXCHARis coming why ReadFile Reads 0 bytes. real
eror is EV_RXCHAR event is comes Two times.
how can I restrict this? or how can ý solve this problem
- Next message: Darius: "driver book for beginners"
- Previous message: Richard Ward: "Re: SetThreadDesktop fails even if I try to associate it with current desktop"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|