Click here to Skip to main content
15,905,776 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 4:38
mvahoney the codewitch30-Sep-23 4:38 
GeneralRe: So this is fun: a war story Pin
Graeme_Grant30-Sep-23 5:34
mvaGraeme_Grant30-Sep-23 5:34 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:11
mvahoney the codewitch30-Sep-23 8:11 
GeneralRe: So this is fun: a war story Pin
Graeme_Grant30-Sep-23 15:10
mvaGraeme_Grant30-Sep-23 15:10 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 15:11
mvahoney the codewitch30-Sep-23 15:11 
GeneralRe: So this is fun: a war story Pin
Graeme_Grant30-Sep-23 15:14
mvaGraeme_Grant30-Sep-23 15:14 
GeneralRe: So this is fun: a war story Pin
Gary Stachelski 202130-Sep-23 8:44
Gary Stachelski 202130-Sep-23 8:44 
GeneralRe: So this is fun: a war story Pin
Mircea Neacsu30-Sep-23 8:06
Mircea Neacsu30-Sep-23 8:06 
honey the codewitch wrote:
I need to spin a thread to continually fetch data from the COM port
Your thread can wait on an event flag using SetCommMask (hComm, EV_RXCHAR);. It's not that straightforward because sometimes, on some COM ports, Windows fails to trigger the event, so your thread has to wait with a timeout and recheck if any character has arrived.

You can see a piece of code here. It is probably more complicated than what you need because it supports multiple clients reading from the same port and also time-tags each incoming character. Code has been in use for eons and it's bulletproof. If you want a stripped down version let me know.
Mircea

GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:07
mvahoney the codewitch30-Sep-23 8:07 
GeneralRe: So this is fun: a war story Pin
jmaida30-Sep-23 15:08
jmaida30-Sep-23 15:08 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 15:10
mvahoney the codewitch30-Sep-23 15:10 
GeneralRe: So this is fun: a war story Pin
jmaida30-Sep-23 15:59
jmaida30-Sep-23 15:59 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:09
mvahoney the codewitch30-Sep-23 8:09 
GeneralRe: So this is fun: a war story Pin
Mircea Neacsu30-Sep-23 8:13
Mircea Neacsu30-Sep-23 8:13 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:14
mvahoney the codewitch30-Sep-23 8:14 
GeneralRe: So this is fun: a war story Pin
Mircea Neacsu30-Sep-23 8:16
Mircea Neacsu30-Sep-23 8:16 
GeneralRe: So this is fun: a war story Pin
honey the codewitch30-Sep-23 8:19
mvahoney the codewitch30-Sep-23 8:19 
GeneralRe: So this is fun: a war story Pin
Mircea Neacsu30-Sep-23 8:29
Mircea Neacsu30-Sep-23 8:29 
GeneralRe: So this is fun: a war story Pin
Daniel Pfeffer30-Sep-23 8:21
professionalDaniel Pfeffer30-Sep-23 8:21 
GeneralRe: So this is fun: a war story Pin
Mircea Neacsu30-Sep-23 8:23
Mircea Neacsu30-Sep-23 8:23 
GeneralHealthcare Apps decision choice Pin
Nand3229-Sep-23 22:08
Nand3229-Sep-23 22:08 
GeneralRe: Healthcare Apps decision choice Pin
OriginalGriff29-Sep-23 22:42
mveOriginalGriff29-Sep-23 22:42 
GeneralRe: Healthcare Apps decision choice Pin
Nand3229-Sep-23 23:08
Nand3229-Sep-23 23:08 
GeneralRe: Healthcare Apps decision choice Pin
honey the codewitch30-Sep-23 1:09
mvahoney the codewitch30-Sep-23 1:09 
GeneralRe: Healthcare Apps decision choice Pin
dandy7230-Sep-23 3:36
dandy7230-Sep-23 3:36 

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.