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

C / C++ / MFC

 
GeneralRe: Converting char to char* Pin
talkster54-May-05 4:39
talkster54-May-05 4:39 
GeneralRe: Converting char to char* Pin
David Crow4-May-05 4:49
David Crow4-May-05 4:49 
GeneralRe: Converting char to char* Pin
talkster54-May-05 5:33
talkster54-May-05 5:33 
GeneralRe: Converting char to char* Pin
David Crow4-May-05 6:07
David Crow4-May-05 6:07 
GeneralRe: Converting char to char* Pin
talkster54-May-05 6:17
talkster54-May-05 6:17 
GeneralRe: Converting char to char* Pin
talkster54-May-05 6:21
talkster54-May-05 6:21 
GeneralRe: Converting char to char* Pin
John R. Shaw4-May-05 9:55
John R. Shaw4-May-05 9:55 
GeneralSetTimer() in Serial Comm Program Question Pin
CNewbie3-May-05 7:59
CNewbie3-May-05 7:59 
Question on How SetTimer() Works:

When the Timer goes off and it calls the OnTimer() function, does it wait until that function ends and the program returns to the OS before the Timer starts its countdown again or does it automatically restart the countdown once the OnTimer() function is called?

My Reason for asking is this:

I made a Multithreaded MFC serial communication program where the flow of data is continuous. Thus the way I have it is I use an Infinite loop of (Read data, do something with data and loopback to read more data), however this causes the cpu time to be completely used (99-100%). Now since the program is much faster then the flow of data what I want to do is: Read data, do something with it, then return to the OS then go back to the read routine and do it again so the cpu is used as minimally as possible.

This is where my question comes in: How could I go about being able to recall the read function once I return to the OS. As per my first question I was thinking of using SetTimer() but I dont know if it is the best possible solution to the problem. Maybe some type of event could work, but I dont think it could be monitored if the program control is with the OS.

Does anyone have any advice or answers to my 2 questions?

Thanks
GeneralRe: SetTimer() in Serial Comm Program Question Pin
Trollslayer3-May-05 12:28
mentorTrollslayer3-May-05 12:28 
GeneralRe: SetTimer() in Serial Comm Program Question Pin
John R. Shaw4-May-05 11:10
John R. Shaw4-May-05 11:10 
GeneralRe: SetTimer() in Serial Comm Program Question Pin
CNewbie4-May-05 11:24
CNewbie4-May-05 11:24 
GeneralRe: SetTimer() in Serial Comm Program Question Pin
John R. Shaw4-May-05 12:09
John R. Shaw4-May-05 12:09 
GeneralCreating a dll using a type library Pin
ChicoM3-May-05 7:51
ChicoM3-May-05 7:51 
GeneralMulti arrays Pin
bitsNbites3-May-05 6:29
bitsNbites3-May-05 6:29 
GeneralRe: Multi arrays Pin
David Crow3-May-05 6:47
David Crow3-May-05 6:47 
GeneralRe: Multi arrays Pin
bitsNbites3-May-05 7:52
bitsNbites3-May-05 7:52 
GeneralRe: Multi arrays Pin
David Crow3-May-05 8:01
David Crow3-May-05 8:01 
GeneralRe: Multi arrays Pin
Priyank Bolia3-May-05 19:52
Priyank Bolia3-May-05 19:52 
GeneralRe: Multi arrays Pin
bitsNbites4-May-05 15:42
bitsNbites4-May-05 15:42 
GeneralRe: Multi arrays Pin
Priyank Bolia4-May-05 18:19
Priyank Bolia4-May-05 18:19 
GeneralPlease help me. Pin
dSolariuM3-May-05 6:12
dSolariuM3-May-05 6:12 
GeneralRe: Please help me. Pin
David Crow3-May-05 6:50
David Crow3-May-05 6:50 
GeneralRe: Please help me. Pin
dSolariuM16-May-05 6:35
dSolariuM16-May-05 6:35 
GeneralFile Version Pin
picasso23-May-05 6:01
picasso23-May-05 6:01 
GeneralRe: File Version Pin
David Crow3-May-05 7:05
David Crow3-May-05 7: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.