WaitCommEvent
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
How can i wait an event only for 5 sec? I have DCB, HANDLE port; DWORD dwEvtMask; CreateFile(port,...); and after i have fSuccess = SetCommMask(port, EV_CTS|EV_DSR); event.hEvent = CreateEvent( NULL, FALSE, FALSE, NULL); if (WaitCommEvent(port, &dwEvtMask, &event)) { if (dwEvtMask & EV_DSR) { //Something to do } } So, i need to wait only for 5 sec, if i couldn't receive something to commport, how can i stop it? And how can i wait 5 sec?