Click here to Skip to main content
15,922,696 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Displaying time for different time zones Pin
David Chamberlain3-Jun-03 7:10
David Chamberlain3-Jun-03 7:10 
GeneralRe: Displaying time for different time zones Pin
dennisV3-Jun-03 7:21
dennisV3-Jun-03 7:21 
Generalcreating a header blueprint that will be written to memory Pin
johnstonsk2-Jun-03 10:41
johnstonsk2-Jun-03 10:41 
General.rc files and encoding Pin
Jon Sagara2-Jun-03 10:09
Jon Sagara2-Jun-03 10:09 
GeneralCMenu question Pin
Anonymous2-Jun-03 9:59
Anonymous2-Jun-03 9:59 
GeneralRe: CMenu question Pin
Maximilien2-Jun-03 10:08
Maximilien2-Jun-03 10:08 
GeneralSerial Communication Problem Pin
GeneMcAulpin2-Jun-03 9:40
GeneMcAulpin2-Jun-03 9:40 
GeneralRe: Serial Communication Problem Pin
Roger Allen3-Jun-03 2:41
Roger Allen3-Jun-03 2:41 
This is how I normally configure the timeouts for a COM port:

COMMTIMEOUTS	timeouts;
			
// return immediately on reads
// return after completion on writes
timeouts.ReadIntervalTimeout = MAXDWORD;
timeouts.ReadTotalTimeoutConstant = 0;
timeouts.ReadTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutConstant = 0;
timeouts.WriteTotalTimeoutMultiplier = 0;
			
SetCommTimeouts(m_hSerialPortHandle, &timeouts);

This means that the WriteFile() call doe snot return until the characters have been sent, but for ReadFile() this becomes a polling operation. I normally loop around a thread that tries to read a character every x ms and sleeps in between. This has always worked well for me. You just need to check the value of dwNumBytesRead in the ReadFile() call.

Hope its of help.



Roger Allen
Sonork 100.10016

Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
QuestionHow to adapt window size to screen resolution Pin
gmlnd2-Jun-03 8:58
gmlnd2-Jun-03 8:58 
AnswerRe: How to adapt window size to screen resolution Pin
Dominik Reichl2-Jun-03 9:44
Dominik Reichl2-Jun-03 9:44 
GeneralRe: How to adapt window size to screen resolution Pin
gmlnd2-Jun-03 10:00
gmlnd2-Jun-03 10:00 
GeneralDisabling checkbox Pin
dorkshoe2-Jun-03 8:55
dorkshoe2-Jun-03 8:55 
GeneralRe: Disabling checkbox Pin
Dominik Reichl2-Jun-03 9:42
Dominik Reichl2-Jun-03 9:42 
GeneralRe: Disabling checkbox Pin
abc8762-Jun-03 9:56
abc8762-Jun-03 9:56 
GeneralRe: Disabling checkbox Pin
Dominik Reichl2-Jun-03 20:35
Dominik Reichl2-Jun-03 20:35 
GeneralRe: Disabling checkbox Pin
abc8762-Jun-03 9:50
abc8762-Jun-03 9:50 
QuestionHICON to HBITMAP? Pin
Dave_2-Jun-03 7:50
Dave_2-Jun-03 7:50 
AnswerRe: HICON to HBITMAP? Pin
Dominik Reichl2-Jun-03 8:43
Dominik Reichl2-Jun-03 8:43 
GeneralWinRTP and CE Pin
javigimenez2-Jun-03 6:53
javigimenez2-Jun-03 6:53 
GeneralProblem with SQLColumns in ODBC API Pin
insanely4202-Jun-03 6:48
insanely4202-Jun-03 6:48 
GeneralRe: Problem with SQLColumns in ODBC API Pin
David Crow2-Jun-03 7:17
David Crow2-Jun-03 7:17 
GeneralRe: Problem with SQLColumns in ODBC API Pin
insanely4202-Jun-03 8:13
insanely4202-Jun-03 8:13 
GeneralRe: Problem with SQLColumns in ODBC API Pin
Anonymous2-Jun-03 9:24
Anonymous2-Jun-03 9:24 
GeneralRe: Problem with SQLColumns in ODBC API Pin
basementman2-Jun-03 9:25
basementman2-Jun-03 9:25 
GeneralCLabel with tooltips Pin
doctorpi2-Jun-03 6:05
doctorpi2-Jun-03 6:05 

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.