Click here to Skip to main content
15,887,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to change day with button click. Pin
Rajesh R Subramanian12-Mar-08 0:05
professionalRajesh R Subramanian12-Mar-08 0:05 
GeneralRe: How to change day with button click. Pin
Ashish Chauhan12-Mar-08 0:58
Ashish Chauhan12-Mar-08 0:58 
GeneralRe: How to change day with button click. Pin
Rajesh R Subramanian11-Mar-08 4:31
professionalRajesh R Subramanian11-Mar-08 4:31 
QuestionQuestion about how to kill thread that i create with _beginthreadex ? Pin
Yanshof10-Mar-08 20:35
Yanshof10-Mar-08 20:35 
AnswerRe: Question about how to kill thread that i create with _beginthreadex ? Pin
Maxwell Chen10-Mar-08 20:40
Maxwell Chen10-Mar-08 20:40 
AnswerRe: Question about how to kill thread that i create with _beginthreadex ? Pin
Peter Weyzen10-Mar-08 20:41
Peter Weyzen10-Mar-08 20:41 
GeneralRe: Question about how to kill thread that i create with _beginthreadex ? [modified] Pin
Yanshof10-Mar-08 21:15
Yanshof10-Mar-08 21:15 
GeneralRe: Question about how to kill thread that i create with _beginthreadex ? Pin
Cedric Moonen10-Mar-08 21:33
Cedric Moonen10-Mar-08 21:33 
Because it is not a natural way to exit your thread. First, if you allocated some resources in your thread, there's no way you will be able to clean them if you are using TerminateThread.
Second, you have no control about what you are doing: you will terminate the thread whatever it was processing. It means you can terminate it in the middle of something important that will be left not terminated (e.g. if you communicate with an external device, you started to send some data to it and then brutally stop it, leaving the device in an unknown state).

It is far better to handle that yourself, using a flag for example: you check regularly if this flag is false, if that's the case, you exit nicely the thread function (the general idea is having a loop that checks for this flag).

Cédric Moonen
Software developer

Charting control [v1.3 - Updated]

GeneralRe: Question about how to kill thread that i create with _beginthreadex ? Pin
Yanshof10-Mar-08 21:39
Yanshof10-Mar-08 21:39 
GeneralRe: Question about how to kill thread that i create with _beginthreadex ? Pin
Peter Weyzen10-Mar-08 21:54
Peter Weyzen10-Mar-08 21:54 
QuestionHow virtual destructor works under the hood? Pin
abhijitr10-Mar-08 19:41
abhijitr10-Mar-08 19:41 
AnswerRe: How virtual destructor works under the hood? Pin
Peter Weyzen10-Mar-08 19:47
Peter Weyzen10-Mar-08 19:47 
GeneralRe: How virtual destructor works under the hood? Pin
Rajkumar R10-Mar-08 23:53
Rajkumar R10-Mar-08 23:53 
GeneralRe: How virtual destructor works under the hood? Pin
Peter Weyzen11-Mar-08 7:46
Peter Weyzen11-Mar-08 7:46 
GeneralRe: How virtual destructor works under the hood? Pin
Rajkumar R11-Mar-08 8:27
Rajkumar R11-Mar-08 8:27 
GeneralRe: How virtual destructor works under the hood? Pin
Peter Weyzen11-Mar-08 8:49
Peter Weyzen11-Mar-08 8:49 
AnswerRe: How virtual destructor works under the hood? Pin
Maxwell Chen10-Mar-08 20:36
Maxwell Chen10-Mar-08 20:36 
GeneralMissing Start Point Pin
Member 461894910-Mar-08 18:29
Member 461894910-Mar-08 18:29 
QuestionRe: Missing Start Point Pin
Maxwell Chen10-Mar-08 19:08
Maxwell Chen10-Mar-08 19:08 
GeneralRe: Missing Start Point Pin
Sameerkumar Namdeo10-Mar-08 22:27
Sameerkumar Namdeo10-Mar-08 22:27 
GeneralWorker thread->crash Pin
lavate malllik10-Mar-08 17:39
lavate malllik10-Mar-08 17:39 
GeneralRe: Worker thread->crash Pin
Stephen Hewitt10-Mar-08 18:00
Stephen Hewitt10-Mar-08 18:00 
GeneralRe: Worker thread->crash Pin
Peter Weyzen10-Mar-08 19:49
Peter Weyzen10-Mar-08 19:49 
GeneralRe: Worker thread->crash Pin
ThatsAlok10-Mar-08 20:36
ThatsAlok10-Mar-08 20:36 
QuestionRe: Worker thread->crash Pin
Maxwell Chen10-Mar-08 20:45
Maxwell Chen10-Mar-08 20:45 

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.