Click here to Skip to main content
15,913,758 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: GetFirstView Position() Pin
led mike13-Jun-06 5:55
led mike13-Jun-06 5:55 
QuestionRe: GetFirstView Position() Pin
David Crow13-Jun-06 6:02
David Crow13-Jun-06 6:02 
AnswerRe: GetFirstView Position() Pin
led mike13-Jun-06 8:55
led mike13-Jun-06 8:55 
QuestionProblem with termination of a thread Pin
SWDevil13-Jun-06 5:44
SWDevil13-Jun-06 5:44 
AnswerRe: Problem with termination of a thread Pin
Justin Tay13-Jun-06 5:56
Justin Tay13-Jun-06 5:56 
AnswerRe: Problem with termination of a thread Pin
led mike13-Jun-06 5:56
led mike13-Jun-06 5:56 
AnswerRe: Problem with termination of a thread Pin
David Crow13-Jun-06 6:03
David Crow13-Jun-06 6:03 
AnswerRe: Problem with termination of a thread Pin
Zac Howland13-Jun-06 6:27
Zac Howland13-Jun-06 6:27 
You will need to do 2 things to do this cleanly:

First, create an event and pass the event to the thread. Each pass of the Thread, use WaitForSingleObject with a low timeout value to see if the thread needs to exit (if it does, do any cleanup you need to and return from the thread).

The first step will allow the thread to exit cleanly. In your main thread, you will need to also add a WaitforSingleObject and use the thread's handle as the object. Use a timeout value appropriate for you (INFINITE is NOT appropriate here as it will deadlock your application's shutdown procedures). If the Wait times out, call TerminateThread with the handle for the thread (this is a forceful killing of the thread).

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac
AnswerRe: Problem with termination of a thread Pin
Jun Du13-Jun-06 8:43
Jun Du13-Jun-06 8:43 
QuestionCString Array Pin
si_6913-Jun-06 5:29
si_6913-Jun-06 5:29 
AnswerRe: CString Array Pin
Jun Du13-Jun-06 5:38
Jun Du13-Jun-06 5:38 
GeneralRe: CString Array Pin
si_6913-Jun-06 5:42
si_6913-Jun-06 5:42 
AnswerRe: CString Array Pin
toxcct13-Jun-06 5:39
toxcct13-Jun-06 5:39 
GeneralRe: CString Array Pin
Rob Caldecott13-Jun-06 10:02
Rob Caldecott13-Jun-06 10:02 
AnswerRe: CString Array Pin
Laxman Auti13-Jun-06 5:42
Laxman Auti13-Jun-06 5:42 
QuestionLinking files - inline, or Dev studio? Pin
Mutty13-Jun-06 4:49
Mutty13-Jun-06 4:49 
AnswerRe: Linking files - inline, or Dev studio? Pin
Chris Losinger13-Jun-06 5:01
professionalChris Losinger13-Jun-06 5:01 
AnswerRe: Linking files - inline, or Dev studio? Pin
Viorel.13-Jun-06 5:03
Viorel.13-Jun-06 5:03 
QuestionMFC Class Wizard has Stopped Working Pin
Jethro6313-Jun-06 4:48
Jethro6313-Jun-06 4:48 
AnswerRe: MFC Class Wizard has Stopped Working Pin
toxcct13-Jun-06 5:02
toxcct13-Jun-06 5:02 
GeneralRe: MFC Class Wizard has Stopped Working Pin
Jethro6313-Jun-06 5:08
Jethro6313-Jun-06 5:08 
GeneralRe: MFC Class Wizard has Stopped Working Pin
bob1697213-Jun-06 5:37
bob1697213-Jun-06 5:37 
Questionhow to convert string to unicode or LPWSTR Pin
iLL eFFect13-Jun-06 4:20
iLL eFFect13-Jun-06 4:20 
AnswerRe: how to convert string to unicode or LPWSTR Pin
Ganesh_T13-Jun-06 4:28
Ganesh_T13-Jun-06 4:28 
AnswerRe: how to convert string to unicode or LPWSTR Pin
Viorel.13-Jun-06 4:42
Viorel.13-Jun-06 4:42 

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.