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

C / C++ / MFC

 
GeneralRe: What happens when an Object of CWinApp derived Class is Created in MFC Pin
Steve S25-Jul-06 21:50
Steve S25-Jul-06 21:50 
GeneralRe: What happens when an Object of CWinApp derived Class is Created in MFC Pin
NiceNaidu25-Jul-06 22:46
NiceNaidu25-Jul-06 22:46 
GeneralRe: What happens when an Object of CWinApp derived Class is Created in MFC Pin
Steve S27-Jul-06 1:42
Steve S27-Jul-06 1:42 
QuestionThread?! Pin
tanarnelinistit25-Jul-06 20:02
tanarnelinistit25-Jul-06 20:02 
AnswerRe: Thread?! Pin
Aneesh Valeri25-Jul-06 20:14
Aneesh Valeri25-Jul-06 20:14 
QuestionRe: Thread?! [modified] Pin
tanarnelinistit25-Jul-06 20:20
tanarnelinistit25-Jul-06 20:20 
AnswerRe: Thread?! Pin
Hamid_RT25-Jul-06 20:23
Hamid_RT25-Jul-06 20:23 
AnswerRe: Thread?! Pin
Steve S25-Jul-06 22:14
Steve S25-Jul-06 22:14 
Typically, your thread will loop continuously, with checks to see if (a) the current read has timed out, in which case you continue, or (b) an event was trggered (See CreateEvent in the API docs), in which case the thread exits. That way, you can trigger the event in your main thread when you want to quit the app, and then wait in the main thread for the comms thread to exit.
You can combine the two by using COMMS events and waiting until either a received character is available or the other event was triggered, and acting accordingly.

P.J.Naughter has written some excellent classes, one of which deals with comms ports, so check that out in the MFC/C++ libraries section here on CP.

Steve S
Developer for hire

AnswerRe: Thread?! Pin
David Crow27-Jul-06 2:57
David Crow27-Jul-06 2:57 
Question3d max object Pin
ooola rocks25-Jul-06 19:59
ooola rocks25-Jul-06 19:59 
AnswerRe: 3d max object Pin
Hamid_RT25-Jul-06 20:12
Hamid_RT25-Jul-06 20:12 
AnswerRe: 3d max object Pin
Cedric Moonen25-Jul-06 20:38
Cedric Moonen25-Jul-06 20:38 
AnswerRe: 3d max object Pin
ldsdbomber26-Jul-06 5:20
ldsdbomber26-Jul-06 5:20 
QuestionHow to call Microsoft C# module in the COM component (C++) Pin
chenxiujie25-Jul-06 19:58
chenxiujie25-Jul-06 19:58 
AnswerRe: How to call Microsoft C# module in the COM component (C++) Pin
sudeesh26-Jul-06 2:35
sudeesh26-Jul-06 2:35 
GeneralRe: How to call Microsoft C# module in the COM component (C++) Pin
chenxiujie26-Jul-06 22:31
chenxiujie26-Jul-06 22:31 
GeneralRe: How to call Microsoft C# module in the COM component (C++) Pin
sudeesh26-Jul-06 23:05
sudeesh26-Jul-06 23:05 
GeneralRe: How to call Microsoft C# module in the COM component (C++) Pin
chenxiujie27-Jul-06 16:03
chenxiujie27-Jul-06 16:03 
QuestionEvents Pin
joshiprashant25-Jul-06 19:34
joshiprashant25-Jul-06 19:34 
AnswerRe: Events Pin
ThatsAlok25-Jul-06 19:51
ThatsAlok25-Jul-06 19:51 
GeneralRe: Events Pin
joshiprashant25-Jul-06 23:04
joshiprashant25-Jul-06 23:04 
AnswerRe: Events Pin
Anilkumar K V25-Jul-06 21:08
Anilkumar K V25-Jul-06 21:08 
GeneralRe: Events Pin
joshiprashant25-Jul-06 23:41
joshiprashant25-Jul-06 23:41 
QuestionExecuting Process Virtually Pin
joshiprashant25-Jul-06 19:31
joshiprashant25-Jul-06 19:31 
AnswerRe: Executing Process Virtually Pin
John M. Drescher25-Jul-06 21:11
John M. Drescher25-Jul-06 21:11 

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.