Click here to Skip to main content
15,905,414 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWindows messaging Pin
BishGada26-Jun-02 0:23
BishGada26-Jun-02 0:23 
GeneralRe: Windows messaging Pin
benjymous26-Jun-02 1:09
benjymous26-Jun-02 1:09 
GeneralRe: Windows messaging Pin
26-Jun-02 1:24
suss26-Jun-02 1:24 
Generalterminate thread Pin
zecodela26-Jun-02 0:10
zecodela26-Jun-02 0:10 
GeneralRe: terminate thread Pin
Rage26-Jun-02 0:42
professionalRage26-Jun-02 0:42 
GeneralRe: terminate thread Pin
zecodela26-Jun-02 15:59
zecodela26-Jun-02 15:59 
GeneralRe: terminate thread Pin
Nish Nishant26-Jun-02 0:47
sitebuilderNish Nishant26-Jun-02 0:47 
GeneralRe: terminate thread Pin
Ramu Pulipati26-Jun-02 17:39
Ramu Pulipati26-Jun-02 17:39 
There are couple of ways to terminate thread safely based on the problem

here is the event approach,

- CreateEvent() (named event to use across process'es)
- CreateThread (or AfxBEginThread) and pass event as Thread Param
- Keep listening to Event Signaling at application atomic times (WaitForSingleObject).
- when Event is signaled or job is done, just return (use AfxEndThread() with AfxBeginThread() - MFC way)

From main/any thread signal the event, when u want to stop the thread safely.

To brutally kill the thread use: TerminateThread()

Refer to samples in codeproject.com OR codeguru.com.

Hth,
Ramu
GeneralRe: terminate thread Pin
zecodela26-Jun-02 17:55
zecodela26-Jun-02 17:55 
GeneralCBitmapButton Pin
turbo19526-Jun-02 0:05
turbo19526-Jun-02 0:05 
GeneralRe: CBitmapButton Pin
Bill Wilson27-Jun-02 10:41
Bill Wilson27-Jun-02 10:41 
QuestionHow to avoid CControlBar show out of a Frame? Pin
Saii Jiang25-Jun-02 23:37
Saii Jiang25-Jun-02 23:37 
GeneralStarting exe in MDI program Pin
JK25-Jun-02 23:23
JK25-Jun-02 23:23 
GeneralRe: Starting exe in MDI program Pin
Nish Nishant26-Jun-02 0:44
sitebuilderNish Nishant26-Jun-02 0:44 
GeneralInstallShield Pin
rrrado25-Jun-02 23:04
rrrado25-Jun-02 23:04 
GeneralRe: InstallShield Pin
rrrado25-Jun-02 23:27
rrrado25-Jun-02 23:27 
Generaldiameter sign in chinese windows 98 Pin
Martin Perktold25-Jun-02 22:39
Martin Perktold25-Jun-02 22:39 
QuestionPlease hlep: how to create a Help file in VB/VC++ project? Pin
DengJW25-Jun-02 22:25
DengJW25-Jun-02 22:25 
AnswerRe: Please hlep: how to create a Help file in VB/VC++ project? Pin
Nish Nishant25-Jun-02 22:42
sitebuilderNish Nishant25-Jun-02 22:42 
GeneralRe: Please hlep: how to create a Help file in VB/VC++ project? Pin
DengJW25-Jun-02 22:58
DengJW25-Jun-02 22:58 
GeneralRe: Please hlep: how to create a Help file in VB/VC++ project? Pin
Nish Nishant25-Jun-02 23:02
sitebuilderNish Nishant25-Jun-02 23:02 
GeneralGot it. Thanks Pin
DengJW25-Jun-02 23:13
DengJW25-Jun-02 23:13 
GeneralDataValidation of text box placed in flexgrid Pin
mageshswami25-Jun-02 21:46
mageshswami25-Jun-02 21:46 
GeneralDetermining paper tray alignment (non-MFC) Pin
25-Jun-02 20:50
suss25-Jun-02 20:50 
GeneralAutomation of legacy Applications Pin
vikramlinux25-Jun-02 19:37
vikramlinux25-Jun-02 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.