Creating Event like in win32 events

  • Thread starter Thread starter R A
  • Start date Start date
R

R A

Hi

How do I create Event handle same as using the win32 CreateEvent? I need the
..net app (c#) to wait for event (such as win 32 waitforsingleobject api).


Thanks,
Ron
 
Ron,

Take a look at the ManualResetEvent and AutoResetEvent classes. They
both derive from WaitHandle, which has static methods which will allow you
to wait on those handles to be set.

Subsequently, you can also set the Handle property of one of these event
classes to a handle returned from CreateEvent (or wherever you get it from)
so that you can use the managed representation of it.

Hope this helps.
 
Back
Top