Click here to Skip to main content
16,017,100 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCreateProcess problem. Pin
david bagaturia21-May-07 1:02
david bagaturia21-May-07 1:02 
AnswerRe: CreateProcess problem. Pin
GuyM21-May-07 1:12
GuyM21-May-07 1:12 
GeneralRe: CreateProcess problem. Pin
david bagaturia21-May-07 2:17
david bagaturia21-May-07 2:17 
QuestionRemoving Title Bar from MDI frame Pin
zubair_ahmed21-May-07 0:30
zubair_ahmed21-May-07 0:30 
AnswerRe: Removing Title Bar from MDI frame Pin
Nelek21-May-07 1:14
protectorNelek21-May-07 1:14 
QuestionWaitForSingleObject Query Pin
Vikas K.20-May-07 23:59
Vikas K.20-May-07 23:59 
AnswerRe: WaitForSingleObject Query Pin
GuyM21-May-07 0:20
GuyM21-May-07 0:20 
AnswerRe: WaitForSingleObject Query Pin
Roger Stoltz21-May-07 0:57
Roger Stoltz21-May-07 0:57 
It looks as if you want to know when the worker thread has finished, right?

Your first alternative waits on an event to be signalled from within the worker thread.
Note that as already advised you have to create the event before it is used or you'll be facing a runtime error eventually.
By using this technique you will be informed when the thread is about to finish. My point is that by the time the event gets signalled and your waiting function is released, the worker thread may or may not have finished completely.
You should wait on the thread handle instead, like you do in your second alternative. The thread handle will enter "signalled" state when the thread has finished completely and has been unloaded from the system.

Read more about worker threads here[^].


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

GeneralRe: WaitForSingleObject Query Pin
Vikas K.21-May-07 3:13
Vikas K.21-May-07 3:13 
QuestionWhat "mapping" is all about? Pin
LiYS20-May-07 23:30
LiYS20-May-07 23:30 
QuestionRe: What "mapping" is all about? Pin
GuyM21-May-07 0:22
GuyM21-May-07 0:22 
AnswerRe: What "mapping" is all about? Pin
LiYS21-May-07 0:28
LiYS21-May-07 0:28 
AnswerRe: What "mapping" is all about? Pin
GuyM21-May-07 0:49
GuyM21-May-07 0:49 
GeneralRe: What "mapping" is all about? [modified] Pin
LiYS21-May-07 0:58
LiYS21-May-07 0:58 
QuestionSDI to MDI Pin
Anilkumar K V20-May-07 22:41
Anilkumar K V20-May-07 22:41 
AnswerRe: SDI to MDI Pin
GuyM21-May-07 0:36
GuyM21-May-07 0:36 
Question#include statements Pin
prithaa20-May-07 22:14
prithaa20-May-07 22:14 
AnswerRe: #include statements Pin
Hamid_RT20-May-07 22:27
Hamid_RT20-May-07 22:27 
AnswerRe: #include statements Pin
Perspx21-May-07 8:50
Perspx21-May-07 8:50 
GeneralRe: #include statements Pin
prithaa21-May-07 20:54
prithaa21-May-07 20:54 
QuestionGrabbing a word under the mouse Pin
Waldermort20-May-07 22:01
Waldermort20-May-07 22:01 
AnswerRe: Grabbing a word under the mouse Pin
Hamid_RT20-May-07 22:15
Hamid_RT20-May-07 22:15 
GeneralRe: Grabbing a word under the mouse Pin
Waldermort20-May-07 22:32
Waldermort20-May-07 22:32 
Questiontcscpy_s.inl Pin
subramanyeswari20-May-07 21:49
subramanyeswari20-May-07 21:49 
QuestionRe: tcscpy_s.inl Pin
GuyM21-May-07 0:42
GuyM21-May-07 0: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.