// JP opened flex table

Click to See Complete Forum and Search --> : Events


phenixa
June 25th, 2008, 03:06 AM
hi,
i am using events in my code,
i set event at function a
and wait for it at function b
but as i see function b receives the same (LAST) event 4 times
anybody have an idea?

HANDLE exvereport[2];
exvereport[0] = reportevent;
exvereport[1] = hExitEvent;
DWORD durum;
while(true)
{
durum = WaitForMultipleObjects(2,exvereport,FALSE,INFINITE);

switch(durum)
{


case WAIT_OBJECT_0+1:
return (0);//end thread

case WAIT_OBJECT_0:
message = useroutput;
break;


}
Sleep(10); //do not use processor %100
}
}

Arjay
June 25th, 2008, 03:38 AM
Have you reset the events before calling the function?

phenixa
June 25th, 2008, 03:45 AM
i had set it auto reset
while creating event

Arjay
June 25th, 2008, 01:06 PM
Add a default: statement to your switch block and use GetLastError() to retrieve the error that appears if there are any issues with the handles or WaitForMultipleObjects call.

//JP added flex table