Click here to Skip to main content
15,667,904 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to Kill the Worker Thread ? Pin
Rajesh R Subramanian14-Apr-09 0:48
professionalRajesh R Subramanian14-Apr-09 0:48 
AnswerMessage Closed Pin
13-Apr-09 23:26
ParagPatel13-Apr-09 23:26 
GeneralRe: How to Kill the Worker Thread ? [modified] Pin
Hamid_RT13-Apr-09 23:39
Hamid_RT13-Apr-09 23:39 
GeneralRe: How to Kill the Worker Thread ? Pin
Cedric Moonen13-Apr-09 23:41
Cedric Moonen13-Apr-09 23:41 
GeneralRe: How to Kill the Worker Thread ? Pin
Suresh H14-Apr-09 0:00
Suresh H14-Apr-09 0:00 
GeneralRe: How to Kill the Worker Thread ? Pin
Rajesh R Subramanian14-Apr-09 0:04
professionalRajesh R Subramanian14-Apr-09 0:04 
GeneralRe: How to Kill the Worker Thread ? Pin
Cedric Moonen14-Apr-09 0:06
Cedric Moonen14-Apr-09 0:06 
GeneralRe: How to Kill the Worker Thread ? PinPopular
Cedric Moonen14-Apr-09 0:05
Cedric Moonen14-Apr-09 0:05 
Maybe you didn't see the replies to his post but it is strongly recommanded not to use TerminateThread.
A better approach would be to pass a pointer to your dialog class to the thread function, and within the thread cast it back to your dialog and call a public function on it. Inside that function you put the code you already provided except that in your loop, you also check if a flag is set or not (this flag is a simple bool which is a member of the dialog). If the flag is set, you simply stop the loop and the function terminates.
When you click on the end button, you can simply set this flag so that the loop stops.

Cédric Moonen
Software developer

Charting control [v1.5]
OpenGL game tutorial in C++

GeneralRe: How to Kill the Worker Thread ? Pin
Suresh H14-Apr-09 0:37
Suresh H14-Apr-09 0:37 
GeneralRe: How to Kill the Worker Thread ? Pin
Cedric Moonen14-Apr-09 0:48
Cedric Moonen14-Apr-09 0:48 
GeneralRe: How to Kill the Worker Thread ? Pin
Rajesh R Subramanian14-Apr-09 1:11
professionalRajesh R Subramanian14-Apr-09 1:11 
GeneralRe: How to Kill the Worker Thread ? Pin
Cedric Moonen14-Apr-09 1:32
Cedric Moonen14-Apr-09 1:32 
GeneralRe: How to Kill the Worker Thread ? Pin
Rajesh R Subramanian14-Apr-09 1:43
professionalRajesh R Subramanian14-Apr-09 1:43 
GeneralRe: How to Kill the Worker Thread ? [modified] Pin
ParagPatel14-Apr-09 0:27
ParagPatel14-Apr-09 0:27 
GeneralRe: How to Kill the Worker Thread ? Pin
David Crow14-Apr-09 3:02
David Crow14-Apr-09 3:02 
GeneralRe: How to Kill the Worker Thread ? Pin
ParagPatel14-Apr-09 3:56
ParagPatel14-Apr-09 3:56 
GeneralRe: How to Kill the Worker Thread ? Pin
David Crow14-Apr-09 3:58
David Crow14-Apr-09 3:58 
GeneralRe: How to Kill the Worker Thread ? Pin
Rajesh R Subramanian14-Apr-09 4:28
professionalRajesh R Subramanian14-Apr-09 4:28 
AnswerRe: How to Kill the Worker Thread ? Pin
Hamid_RT13-Apr-09 23:40
Hamid_RT13-Apr-09 23:40 
AnswerRe: How to Kill the Worker Thread ? Pin
David Crow14-Apr-09 2:55
David Crow14-Apr-09 2:55 
Questionusing database in project Pin
sunny_vc13-Apr-09 22:51
sunny_vc13-Apr-09 22:51 
AnswerRe: using database in project Pin
_AnsHUMAN_ 13-Apr-09 22:57
_AnsHUMAN_ 13-Apr-09 22:57 
QuestionHow to update the title bar of a window with C & Win32 APIs only? Pin
mr2_9313-Apr-09 22:48
mr2_9313-Apr-09 22:48 
AnswerRe: How to update the title bar of a window with C & Win32 APIs only? Pin
Hamid_RT13-Apr-09 23:46
Hamid_RT13-Apr-09 23:46 
GeneralRe: How to update the title bar of a window with C & Win32 APIs only? Pin
mr2_9313-Apr-09 23:59
mr2_9313-Apr-09 23:59 

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.