Click here to Skip to main content
15,911,039 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: some more details required ot solve. Pin
megha_gharote30-Aug-07 20:31
megha_gharote30-Aug-07 20:31 
GeneralRe: some more details required ot solve. Pin
chandu00430-Aug-07 20:39
chandu00430-Aug-07 20:39 
GeneralRe: some more details required ot solve. Pin
Mark Salsbery30-Aug-07 20:39
Mark Salsbery30-Aug-07 20:39 
Generalsolution Pin
chandu00430-Aug-07 20:44
chandu00430-Aug-07 20:44 
GeneralRe: solution Pin
megha_gharote30-Aug-07 21:07
megha_gharote30-Aug-07 21:07 
GeneralRe: solution Pin
Nishad S30-Aug-07 21:11
Nishad S30-Aug-07 21:11 
GeneralRe: solution Pin
chandu00430-Aug-07 21:20
chandu00430-Aug-07 21:20 
GeneralRe: some more details required ot solve. Pin
JudyL_MD31-Aug-07 2:12
JudyL_MD31-Aug-07 2:12 
First, as Mark said, if the initiating thread has to wait for the second thread to finish, why bother with the second thread?

To answer your question, consider this from the MSDN description of CreateEvent:

If lpName matches the name of an existing named event object, this function requests the EVENT_ALL_ACCESS access right. In this case, the bManualReset and bInitialState parameters are ignored because they have already been set by the creating process<br />
<emphasis mine>


Since I don't see a CloseHandle anywhere, I bet you're reusing the event without resetting it's state. Try adding a ResetEvent function call before starting your secondary thread. OR Switch to an unnamed event - you don't need a named event since you reach back into the app to get the event handle in your secondary thread.

Judy
QuestionCFile Pin
Try30-Aug-07 20:08
Try30-Aug-07 20:08 
AnswerRe: CFile Pin
chandu00430-Aug-07 20:15
chandu00430-Aug-07 20:15 
GeneralRe: CFile Pin
Try30-Aug-07 20:21
Try30-Aug-07 20:21 
GeneralRe: CFile Pin
chandu00430-Aug-07 20:48
chandu00430-Aug-07 20:48 
GeneralRe: CFile Pin
Try30-Aug-07 20:53
Try30-Aug-07 20:53 
GeneralRe: CFile Pin
chandu00430-Aug-07 21:02
chandu00430-Aug-07 21:02 
GeneralRe: CFile Pin
Mark Salsbery31-Aug-07 6:20
Mark Salsbery31-Aug-07 6:20 
AnswerRe: CFile Pin
Nishad S30-Aug-07 21:18
Nishad S30-Aug-07 21:18 
QuestionHow To Track the MOUSE ????????? Pin
GauranG Shah30-Aug-07 20:05
GauranG Shah30-Aug-07 20:05 
AnswerRe: How To Track the MOUSE ????????? Pin
chandu00430-Aug-07 20:09
chandu00430-Aug-07 20:09 
AnswerRe: How To Track the MOUSE ????????? Pin
Nishad S30-Aug-07 21:04
Nishad S30-Aug-07 21:04 
QuestionPDF output Pin
Sangeetha_J30-Aug-07 19:27
Sangeetha_J30-Aug-07 19:27 
AnswerRe: PDF output Pin
Nishad S30-Aug-07 21:07
Nishad S30-Aug-07 21:07 
GeneralRe: PDF output Pin
Sangeetha_J30-Aug-07 21:22
Sangeetha_J30-Aug-07 21:22 
GeneralRe: PDF output Pin
Nishad S30-Aug-07 21:27
Nishad S30-Aug-07 21:27 
AnswerRe: PDF output Pin
Sangeetha_J30-Aug-07 23:50
Sangeetha_J30-Aug-07 23:50 
Question[Solved] Visual Studio ncb file [modified] Pin
George_George30-Aug-07 19:21
George_George30-Aug-07 19:21 

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.