Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionFormatting double as currency? Pin
Scot Reed23-Feb-00 6:47
sussScot Reed23-Feb-00 6:47 
AnswerRE: Formatting double as currency? Pin
Mike Dunn26-Feb-00 7:46
Mike Dunn26-Feb-00 7:46 
GeneralMircosoft Sample Downloads Pin
Anonymous23-Feb-00 4:56
suss Anonymous23-Feb-00 4:56 
QuestionCEdit: how to cancel initial text selection in propPage? Pin
Anonymous23-Feb-00 1:00
suss Anonymous23-Feb-00 1:00 
AnswerRE: CEdit: how to cancel initial text selection in propPage? Pin
AssAssIn2-Mar-00 19:27
AssAssIn2-Mar-00 19:27 
GeneralWindows NT Symbols Setup Pin
Michael Martin22-Feb-00 19:03
Michael Martin22-Feb-00 19:03 
GeneralSerial communication with Win32 API Pin
Rico Salfer22-Feb-00 3:25
Rico Salfer22-Feb-00 3:25 
GeneralRE: Serial communication with Win32 API Pin
Vernon Sauder2-Mar-00 14:08
Vernon Sauder2-Mar-00 14:08 
I also use the ReadFile for serial comm and I found that the problem I was having was that I was using the same overlapped object for both Put and Get. If I did a Put while a Get was waiting for data, the stuff would get trashed. I made sure that only one was doing overlapped operation and the other was just doing a WaitCommEvent. I also found that the number of bytes read that ReadFile returns was not correct. I just figure out the length on my own with a strlen().

Vern
==================
The original message was:

Hello,

I'm a software developer and have following problem
with Win32 API and serial communication :

In my protocol is a read thread to receive bytes.
The function ReadFile() reads one Byte from serial
interface (COM1 or COM2). I use an overlapped
structure to receive data. If there is an error
the function WaitForSingleObject() is called. Usually
the receive is correct. Sometimes the function
ReadFile() don't read a Byte although the InQueue
has a byte. The function WaitForSingleObject() is called.
This function returns with WAIT_TIMEOUT, the current
Byte is lost.
If I call in this case PurgeComm(), the lost Byte is in
the buffer which was in ReadFile() the input buffer.
But this algorithm don't works correct every time.

How can I read the Byte in the InQueue if this byte
can't read from a Win32 API function ?
How can I avoid this problem ?

Good buy
Rico Salfer

GeneralCode Optimization Pin
schler20-Feb-00 0:54
schler20-Feb-00 0:54 
GeneralWebBrowser Pin
Lilach19-Feb-00 22:39
suss Lilach19-Feb-00 22:39 
GeneralRE: WebBrowser Pin
Member 105422-Feb-00 2:07
Member 105422-Feb-00 2:07 
GeneralMinimize in modal child dialogs Pin
Jeremy Davis16-Feb-00 22:33
Jeremy Davis16-Feb-00 22:33 
QuestionHow To Change Dialog BackGround Color on the FLy, Pin
Buck16-Feb-00 13:38
Buck16-Feb-00 13:38 
AnswerRE: How To Change Dialog BackGround Color on the FLy, Pin
Jeremy Davis16-Feb-00 22:34
Jeremy Davis16-Feb-00 22:34 
GeneralRE: RE: How To Change Dialog BackGround Color on the FLy, Pin
Buck17-Feb-00 9:39
Buck17-Feb-00 9:39 
Generalimplementing splitter windows Pin
Walter Gildersleeve15-Feb-00 7:03
Walter Gildersleeve15-Feb-00 7:03 
GeneralRE: implementing splitter windows Pin
Tomas Erlingsson23-Feb-00 9:44
sussTomas Erlingsson23-Feb-00 9:44 
Generalremote execution of a program Pin
LM15-Feb-00 4:43
suss LM15-Feb-00 4:43 
GeneralWhere is Working Set Tuner Pin
Jonathan Gilligan14-Feb-00 5:43
Jonathan Gilligan14-Feb-00 5:43 
GeneralRE: Where is Working Set Tuner Pin
Robert Zakrison15-Feb-00 7:15
sussRobert Zakrison15-Feb-00 7:15 
GeneralRE: RE: Where is Working Set Tuner Pin
Jonathan Gilligan16-Feb-00 5:53
Jonathan Gilligan16-Feb-00 5:53 
GeneralOfficial word from MS: WST is withdrawn from PSDK Pin
Jonathan Gilligan16-Feb-00 5:57
Jonathan Gilligan16-Feb-00 5:57 
GeneralPls help me Pin
hailn14-Feb-00 4:51
hailn14-Feb-00 4:51 
GeneralRE: Pls help me Pin
Mike Dunn14-Feb-00 16:14
Mike Dunn14-Feb-00 16:14 
Generalproblem refreshing CD label in browse dialog Pin
Leeds10-Feb-00 1:55
Leeds10-Feb-00 1:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.