CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Events

Threaded View

  1. #1
    Join Date
    Jun 2008
    Posts
    13

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured