|
-
June 25th, 2008, 02:06 AM
#1
Events
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?
Code:
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
}
}
Last edited by phenixa; June 25th, 2008 at 02:45 AM.
-
June 25th, 2008, 02:38 AM
#2
Re: Events
Have you reset the events before calling the function?
-
June 25th, 2008, 02:45 AM
#3
Re: Events
i had set it auto reset
while creating event
-
June 25th, 2008, 12:06 PM
#4
Re: Events
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|