Board index » delphi » difference beetween Waitcomevent Win95/98 and WinNT ???
Anna Dolguikh
![]() Delphi Developer |
Sat, 18 Jan 2003 03:00:00 GMT
|
Anna Dolguikh
![]() Delphi Developer |
Sat, 18 Jan 2003 03:00:00 GMT
difference beetween Waitcomevent Win95/98 and WinNT ???
Good morning from,
I have a problem with and event from a COM PORT After to have create my com port with the following code : ****** HandlePort:=CreateFile( And init the comport with a correct DCB , i set the mask under the PORT via ****** SetCommMask(HandlePort, EV_RLSD); {to recept an RLSD event} create an event via : ******ov.hEvent := CreateEvent(nil,TRUE,FALSE,Nil); {with ov : OVERLAPPED} and wait the event : ***** WaitCommEvent(HandlePort,ov.hEvent,@ov); This code all ready under windows95/98, it is right and the event is If anyone can help me Pleased.... Thanks... |
AlanGLLo
![]() Delphi Developer |
Sun, 19 Jan 2003 03:00:00 GMT
Re:difference beetween Waitcomevent Win95/98 and WinNT ???In article <8m7dhk$9d...@front6.grolier.fr>, "Anna Dolguikh" Quote<ceda...@club-internet.fr> writes: creates an event object whose handle is stored in the OverlappedStatus.hEvent element. The second parameter of WaitCommEvent is a DWord which receives a mask for the type of event which happened. Because you are waiting for only an RLSD event only one type of event can happen, but if one has to wait for a number of events then one has to test this DWord to establish what evented. You appear to have overwritten the handle of the event object - to use a technical phrase, it has been "{*word*81}ed up" <g>. A couple of notes :- 2 I used a thread to watch the port which could time-out and be reset, or was 3 When an event happened one then has to immediately GetCommModemStatus to see Dealing with commports and watching them reminds me of the early Dungeons and Alan Lloyd |
Grindl
![]() Delphi Developer |
Sun, 19 Jan 2003 03:00:00 GMT
Re:difference beetween Waitcomevent Win95/98 and WinNT ???I used WaitForSingleObject in a COM thread - this seemed like the best way to avoid WaitCommEvent pegging the CPU, it worked OK on 95/98 and NT. try // Wait for 3 secs for a character to arrive at the port WaitCommEvent(hComm, EventMask, posWait); // overlapped dwResult := WaitForSingleObject(posWait.hEvent, 3000); case dwResult of WAIT_OBJECT_0 : // Operation completed begin if not GetOverlappedResult(hComm, osWait, NumRead, False) then // GetOverlappedResult returns FALSE if error raise ECOMError.Create('WaitCommEvent completed, but ' + 'GetLastError returned ' + IntToStr(GetLastError)) end; WAIT_TIMEOUT : // nothing arrived after 3 secs On Tue, 1 Aug 2000 23:06:59 +0200, "Anna Dolguikh" Quote<ceda...@club-internet.fr> wrote: |
1. Difference with C++builder5 beetween Win 2000 and 98
3. Ellipse() on Win95/98 vs. WinNT/2000
4. Ellipse() on Win95/98 vs. WinNT/2000
5. WinNT/95/98 Builder problem.
6. Indy - difference between '98 and NT
7. Windows 98 - Windows NT differences ?
8. Difference in behaviour NT 4.0 and Windows 98
9. extend borland pascal to long filenames and use of win95/98/me/xp filedialogs