Click here to Skip to main content
15,899,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CEdit::LineLength question - DONE Pin
brianwelsch25-Nov-02 4:08
brianwelsch25-Nov-02 4:08 
GeneralMultithreading in NT Pin
Madmaximus19-Nov-02 10:23
Madmaximus19-Nov-02 10:23 
GeneralRe: Multithreading in NT Pin
Joaquín M López Muñoz19-Nov-02 11:42
Joaquín M López Muñoz19-Nov-02 11:42 
GeneralRe: Multithreading in NT Pin
Madmaximus20-Nov-02 2:11
Madmaximus20-Nov-02 2:11 
GeneralRe: Multithreading in NT Pin
Joaquín M López Muñoz20-Nov-02 2:30
Joaquín M López Muñoz20-Nov-02 2:30 
GeneralRe: Multithreading in NT Pin
Madmaximus21-Nov-02 4:18
Madmaximus21-Nov-02 4:18 
GeneralRe: Multithreading in NT Pin
Joaquín M López Muñoz21-Nov-02 7:50
Joaquín M López Muñoz21-Nov-02 7:50 
GeneralRe: Multithreading in NT Pin
Madmaximus22-Nov-02 9:03
Madmaximus22-Nov-02 9:03 
Hi again,

Ok, here is my latest attempt to resolve this.

Handle mMutex;
mMutex = CreatMutex(...);
ThreadFunc()
{
while (1)
{
WORD wdCheck = WaitForSingleObject(dwRun, INFINITE);
switch (wdCheck)
{
case: 0
{
WaitForSingleObject(mMutex, INFINITE); // New code here.

for (int I = 0; I < vI.size(); ++I)
...

ReleaseMutex(mMutex); // New code here.
SetEvent(dwWait); // Now vector is empty send event.
}
case: 1
{
}
}
}

void Wait()
{
WaitForSingleObject(mMutex, INFINITE); //New code here.

if (vI.size() != 0)
{
ResetEvent(dwWait); // This will make sure to wait for event.
ReleaseMutex(mMutex); // New code here.

WaitForSingleObject(dwWait, INFINITE);
}

ReleaseMutex(mMutex); // New code here.
}


Wooweee, I think I got it right this time.

Again thanks for all of your help. Cool | :cool:
Ken
GeneralCanceling the closing of a modal dialog Pin
Ken Goguen19-Nov-02 9:11
Ken Goguen19-Nov-02 9:11 
GeneralRe: Canceling the closing of a modal dialog Pin
RobJones19-Nov-02 9:19
RobJones19-Nov-02 9:19 
GeneralRe: Canceling the closing of a modal dialog Pin
Ken Goguen19-Nov-02 9:30
Ken Goguen19-Nov-02 9:30 
GeneralRe: Canceling the closing of a modal dialog Pin
Joaquín M López Muñoz19-Nov-02 9:55
Joaquín M López Muñoz19-Nov-02 9:55 
GeneralRe: Canceling the closing of a modal dialog Pin
Navin19-Nov-02 11:20
Navin19-Nov-02 11:20 
GeneralMessagebox and Manifest Pin
S van Leent19-Nov-02 8:29
S van Leent19-Nov-02 8:29 
GeneralRe: Messagebox and Manifest Pin
Joaquín M López Muñoz19-Nov-02 10:11
Joaquín M López Muñoz19-Nov-02 10:11 
GeneralRe: Messagebox and Manifest Pin
S van Leent19-Nov-02 10:16
S van Leent19-Nov-02 10:16 
GeneralRe: Messagebox and Manifest Pin
S van Leent19-Nov-02 10:24
S van Leent19-Nov-02 10:24 
GeneralSaving a pointer to file Pin
Peter Molnar19-Nov-02 8:07
Peter Molnar19-Nov-02 8:07 
GeneralRe: Saving a pointer to file Pin
Christian Graus19-Nov-02 8:18
protectorChristian Graus19-Nov-02 8:18 
GeneralRe: Saving a pointer to file Pin
Maximilien19-Nov-02 8:23
Maximilien19-Nov-02 8:23 
GeneralRe: Saving a pointer to file Pin
Paul M Watt19-Nov-02 8:33
mentorPaul M Watt19-Nov-02 8:33 
GeneralRe: Saving a pointer to file Pin
Peter Molnar19-Nov-02 9:15
Peter Molnar19-Nov-02 9:15 
GeneralRe: Saving a pointer to file Pin
Maximilien19-Nov-02 9:32
Maximilien19-Nov-02 9:32 
GeneralRe: Saving a pointer to file Pin
Paul M Watt19-Nov-02 9:48
mentorPaul M Watt19-Nov-02 9:48 
GeneralRe: Saving a pointer to file Pin
S van Leent19-Nov-02 10:59
S van Leent19-Nov-02 10:59 

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.