Click here to Skip to main content
15,903,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: enabling keyboard shortcuts in my application Pin
Rajesh R Subramanian13-Feb-09 5:05
professionalRajesh R Subramanian13-Feb-09 5:05 
QuestionWIN32 Com port ReadFile() Gets delay Pin
yctsai12-Feb-09 20:31
yctsai12-Feb-09 20:31 
AnswerRe: WIN32 Com port ReadFile() Gets delay Pin
Cedric Moonen12-Feb-09 20:38
Cedric Moonen12-Feb-09 20:38 
GeneralRe: WIN32 Com port ReadFile() Gets delay Pin
yctsai12-Feb-09 20:49
yctsai12-Feb-09 20:49 
GeneralRe: WIN32 Com port ReadFile() Gets delay Pin
Cedric Moonen12-Feb-09 21:05
Cedric Moonen12-Feb-09 21:05 
GeneralRe: WIN32 Com port ReadFile() Gets delay Pin
yctsai12-Feb-09 23:24
yctsai12-Feb-09 23:24 
GeneralRe: WIN32 Com port ReadFile() Gets delay Pin
Stuart Dootson12-Feb-09 21:56
professionalStuart Dootson12-Feb-09 21:56 
QuestionRe: WIN32 Com port ReadFile() Gets delay Pin
Roger Stoltz12-Feb-09 23:05
Roger Stoltz12-Feb-09 23:05 
It may be that your thread is preempted as Cédric suggested.

But, it may also be that your call to ::ReadFile() doesn't return immediately due to how you have set up your port and whether you're using overlapped I/O or not.

So; I have two questions:
  1. What values have you assigned the members of the COMMTIMEOUTS struct when calling ::SetCommTimeouts()?
    This is essential since your call may block until it receives something on the port.
  2. Are you using overlapped I/O?

My point is that the delay you're experiencing may be caused by the device connected to your port as well as any context switches.

I also suggest you have a look at this article[^] about serial communication.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


AnswerRe: WIN32 Com port ReadFile() Gets delay Pin
David Crow13-Feb-09 2:49
David Crow13-Feb-09 2:49 
Questionsqrt() pow() fabs() do not work Pin
Member 337533412-Feb-09 19:23
Member 337533412-Feb-09 19:23 
AnswerRe: sqrt() pow() fabs() do not work Pin
Cedric Moonen12-Feb-09 20:18
Cedric Moonen12-Feb-09 20:18 
GeneralRe: sqrt() pow() fabs() do not work Pin
Nishad S12-Feb-09 21:33
Nishad S12-Feb-09 21:33 
GeneralRe: sqrt() pow() fabs() do not work Pin
Cedric Moonen12-Feb-09 21:37
Cedric Moonen12-Feb-09 21:37 
GeneralRe: sqrt() pow() fabs() do not work Pin
David Crow13-Feb-09 2:51
David Crow13-Feb-09 2:51 
GeneralRe: sqrt() pow() fabs() do not work Pin
Chris Losinger13-Feb-09 4:17
professionalChris Losinger13-Feb-09 4:17 
GeneralRe: sqrt() pow() fabs() do not work Pin
Alexander M.,15-Feb-09 7:37
Alexander M.,15-Feb-09 7:37 
GeneralRe: sqrt() pow() fabs() do not work Pin
Chris Losinger13-Feb-09 4:16
professionalChris Losinger13-Feb-09 4:16 
GeneralRe: sqrt() pow() fabs() do not work Pin
Nishad S15-Feb-09 17:29
Nishad S15-Feb-09 17:29 
QuestionAlternative for CMap in MFC Pin
Ramasani12-Feb-09 18:30
Ramasani12-Feb-09 18:30 
AnswerRe: Alternative for CMap in MFC Pin
Cedric Moonen12-Feb-09 20:19
Cedric Moonen12-Feb-09 20:19 
GeneralRe: Alternative for CMap in MFC Pin
Arman S.12-Feb-09 20:49
Arman S.12-Feb-09 20:49 
GeneralRe: Alternative for CMap in MFC Pin
Ramasani12-Feb-09 22:11
Ramasani12-Feb-09 22:11 
GeneralRe: Alternative for CMap in MFC Pin
Arman S.12-Feb-09 22:33
Arman S.12-Feb-09 22:33 
QuestionHow to get the available ports? Pin
AnithaSubramani12-Feb-09 18:15
AnithaSubramani12-Feb-09 18:15 
AnswerRe: How to get the available ports? Pin
SandipG 12-Feb-09 19:53
SandipG 12-Feb-09 19:53 

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.