Click here to Skip to main content
15,908,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can Terminate AfxbeginThread ? [modified] Pin
Le@rner12-Jan-11 19:26
Le@rner12-Jan-11 19:26 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 20:35
Andrew Brock12-Jan-11 20:35 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 20:40
Le@rner12-Jan-11 20:40 
AnswerRe: How can Terminate AfxbeginThread ? [modified] Pin
Andrew Brock12-Jan-11 20:58
Andrew Brock12-Jan-11 20:58 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 21:17
Le@rner12-Jan-11 21:17 
AnswerRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 21:21
Andrew Brock12-Jan-11 21:21 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 21:30
Le@rner12-Jan-11 21:30 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 22:26
Andrew Brock12-Jan-11 22:26 
I would guess that you are overriding the Run() function, in which case the default CWinThread::Run() code won't be executed.
If you look at the default implementation in C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\thrdcore.cpp you will see that there is a message pump in it which will not be executed unless you manually execute it.

The Run() function is rarely overridden, however there are legitimate uses for it.
Depending on what you are trying to do, it may be possible to not override it, or to incorporate the message pump into your code.

Just note that you can't just exit a function when you tell it to quit... if it is waiting on data from the network, then it must receive that data or time out before the function returns
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 23:13
Le@rner12-Jan-11 23:13 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock13-Jan-11 0:11
Andrew Brock13-Jan-11 0:11 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 23:42
Le@rner12-Jan-11 23:42 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Andrew Brock12-Jan-11 23:56
Andrew Brock12-Jan-11 23:56 
GeneralRe: How can Terminate AfxbeginThread ? Pin
Le@rner12-Jan-11 23:59
Le@rner12-Jan-11 23:59 
AnswerRe: How can Terminate AfxbeginThread ? Pin
Prasann Mayekar12-Jan-11 18:59
Prasann Mayekar12-Jan-11 18:59 
AnswerRe: How can Terminate AfxbeginThread ? Pin
Cedric Moonen12-Jan-11 20:49
Cedric Moonen12-Jan-11 20:49 
QuestionWhile Statement Issue. Pin
Mike Certini12-Jan-11 17:53
Mike Certini12-Jan-11 17:53 
AnswerRe: While Statement Issue. Pin
David Crow12-Jan-11 17:57
David Crow12-Jan-11 17:57 
GeneralRe: While Statement Issue. Pin
Andrew Brock12-Jan-11 18:06
Andrew Brock12-Jan-11 18:06 
GeneralRe: While Statement Issue. Pin
Mike Certini12-Jan-11 18:23
Mike Certini12-Jan-11 18:23 
GeneralRe: While Statement Issue. Pin
Andrew Brock12-Jan-11 18:35
Andrew Brock12-Jan-11 18:35 
GeneralRe: While Statement Issue. Pin
Mike Certini12-Jan-11 18:48
Mike Certini12-Jan-11 18:48 
GeneralRe: While Statement Issue. Pin
Malli_S12-Jan-11 19:02
Malli_S12-Jan-11 19:02 
GeneralCorrected Version. Pin
Mike Certini12-Jan-11 19:27
Mike Certini12-Jan-11 19:27 
GeneralRe: Corrected Version. Pin
Andrew Brock12-Jan-11 19:34
Andrew Brock12-Jan-11 19:34 
GeneralRe: Corrected Version. Pin
Andrew Brock12-Jan-11 19:37
Andrew Brock12-Jan-11 19:37 

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.