Click here to Skip to main content
15,896,154 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: post message from one dialog to another dialog Pin
Matthew Faithfull9-Sep-07 23:48
Matthew Faithfull9-Sep-07 23:48 
AnswerRe: post message from one dialog to another dialog Pin
Nishad S9-Sep-07 23:49
Nishad S9-Sep-07 23:49 
QuestionRe: post message from one dialog to another dialog Pin
David Crow10-Sep-07 5:38
David Crow10-Sep-07 5:38 
Questionpostmessage and send message Pin
bhogavalli suresh9-Sep-07 23:33
bhogavalli suresh9-Sep-07 23:33 
AnswerRe: postmessage and send message Pin
Russell'9-Sep-07 23:37
Russell'9-Sep-07 23:37 
AnswerRe: postmessage and send message Pin
ThatsAlok10-Sep-07 2:53
ThatsAlok10-Sep-07 2:53 
AnswerRe: postmessage and send message Pin
David Crow10-Sep-07 5:39
David Crow10-Sep-07 5:39 
QuestionAccessing the serial port in multithreading [modified] Pin
Cedric Moonen9-Sep-07 22:39
Cedric Moonen9-Sep-07 22:39 
Hello !

I would like to access the serial port in a multithreaded application. What I would like to do, is to have one thread which is responsible for reading continuously the port (so, an endless loop). I would like to make a blocking read (so that I don't have a busy loop for reading). So far, so good, I can configure the COMMTIMEOUTS this way:
- ReadIntervalTimeout = MAXDWORD
- ReadTotalTimeoutConstant = 10
- ReadTotalTimeoutMultiplier = MAXDWORD

So, this means that the following happens (from MSDN):

If there are any bytes in the input buffer, ReadFile returns immediately with the bytes in the buffer. <br />
<br />
If there are no bytes in the input buffer, ReadFile waits until a byte arrives and then returns immediately. <br />
<br />
If no bytes arrive within the time specified by ReadTotalTimeoutConstant, ReadFile times out. <br />


I'm doing that only to check if my application terminates or not (otherwise, I could have an infinite timeout).

This part works fine. But the operations on the serial port are serialized meaning that when I want to write something on the port from another thread, it will wait until the read operation finishes (so, in the worst case it can wait 10 msec).

I'm developping an application on Windows Mobile 5 and it should be real-time (particularly for that part of the application).
I could use overlapped operations but it seems that it is not supported on windows mobile 5 Sigh | :sigh:

I could also make the read operation returns immediately but then I will need to put a little sleep (1 msec) between each read operation and I do not want to do this.

So, if anybody knows a way to read and write simeltaneously on the serial port, it will be really appreciated.
GeneralRe: Accessing the serial port in multithreading Pin
Matthew Faithfull9-Sep-07 22:51
Matthew Faithfull9-Sep-07 22:51 
GeneralRe: Accessing the serial port in multithreading Pin
Cedric Moonen9-Sep-07 23:40
Cedric Moonen9-Sep-07 23:40 
GeneralRe: Accessing the serial port in multithreading Pin
Matthew Faithfull9-Sep-07 23:43
Matthew Faithfull9-Sep-07 23:43 
AnswerRe: Accessing the serial port in multithreading Pin
Roger Stoltz10-Sep-07 0:23
Roger Stoltz10-Sep-07 0:23 
QuestionDrive's last formatted date/time Pin
vipin_nvk9-Sep-07 22:00
vipin_nvk9-Sep-07 22:00 
QuestionDraw on the none-client area [modified] Pin
kcynic9-Sep-07 21:47
kcynic9-Sep-07 21:47 
AnswerRe: Draw on the none-client area Pin
Jason Teagle9-Sep-07 22:14
Jason Teagle9-Sep-07 22:14 
GeneralRe: Draw on the none-client area Pin
kcynic9-Sep-07 22:49
kcynic9-Sep-07 22:49 
AnswerRe: Draw on the none-client area Pin
Naveen9-Sep-07 22:32
Naveen9-Sep-07 22:32 
GeneralRe: Draw on the none-client area Pin
kcynic9-Sep-07 22:50
kcynic9-Sep-07 22:50 
GeneralRe: Draw on the none-client area Pin
Naveen9-Sep-07 23:15
Naveen9-Sep-07 23:15 
GeneralRe: Draw on the none-client area Pin
kcynic10-Sep-07 16:31
kcynic10-Sep-07 16:31 
QuestionChild-process without parents Pin
baerten9-Sep-07 21:31
baerten9-Sep-07 21:31 
AnswerRe: Child-process without parents [modified] Pin
Stephen Hewitt9-Sep-07 22:26
Stephen Hewitt9-Sep-07 22:26 
GeneralRe: Child-process without parents Pin
baerten9-Sep-07 22:50
baerten9-Sep-07 22:50 
GeneralRe: Child-process without parents Pin
Stephen Hewitt10-Sep-07 14:37
Stephen Hewitt10-Sep-07 14:37 
GeneralRe: Child-process without parents Pin
baerten10-Sep-07 21:52
baerten10-Sep-07 21:52 

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.