Creating Event like in win32 events

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top