Click here to Skip to main content
15,921,841 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaltoolbar Pin
26-Jun-02 1:52
suss26-Jun-02 1:52 
Generaltoolbar Pin
26-Jun-02 1:49
suss26-Jun-02 1:49 
GeneralRe: toolbar Pin
Rage26-Jun-02 4:06
professionalRage26-Jun-02 4:06 
GeneralMy static control flickers when updating it frequently... Pin
Tommy Svensson26-Jun-02 1:22
Tommy Svensson26-Jun-02 1:22 
GeneralRe: My static control flickers when updating it frequently... Pin
Stan the man26-Jun-02 1:26
Stan the man26-Jun-02 1:26 
GeneralRe: My static control flickers when updating it frequently... Pin
Tommy Svensson26-Jun-02 1:31
Tommy Svensson26-Jun-02 1:31 
GeneralRe: My static control flickers when updating it frequently... Pin
Chris Losinger26-Jun-02 5:09
professionalChris Losinger26-Jun-02 5:09 
GeneralRe: My static control flickers when updating it frequently... Pin
Scott H. Settlemier27-Jun-02 9:14
Scott H. Settlemier27-Jun-02 9:14 
GeneralInstall shield Pin
rrrado26-Jun-02 1:13
rrrado26-Jun-02 1:13 
GeneralRe: Install shield Pin
Nish Nishant26-Jun-02 1:55
sitebuilderNish Nishant26-Jun-02 1:55 
GeneralRe: Install shield Pin
rrrado26-Jun-02 2:37
rrrado26-Jun-02 2:37 
GeneralRe: Install shield Pin
User 665826-Jun-02 2:53
User 665826-Jun-02 2:53 
GeneralRe: Install shield Pin
rrrado26-Jun-02 4:14
rrrado26-Jun-02 4:14 
GeneralRe: Install shield Pin
Tommy Svensson26-Jun-02 7:04
Tommy Svensson26-Jun-02 7:04 
QuestionPrinting for one doc, multiple views? Pin
Hel26-Jun-02 0:32
Hel26-Jun-02 0:32 
AnswerRe: Printing for one doc, multiple views? Pin
Roger Allen26-Jun-02 2:40
Roger Allen26-Jun-02 2:40 
GeneralRe: Printing for one doc, multiple views? Pin
Hel26-Jun-02 5:47
Hel26-Jun-02 5:47 
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

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.