N
nickdu
I'm using interop (PInvoke) to call a method
(FindFirstPrinterChangeNotification) which returns an event handle. I would
like to stay as much as possible in managed code so I want to get this native
event handle into a managed WaitHandle so I can call one of the WaitHandle's
Wait() methods. How do I do this?
The only way I see is to either:
1. Create an EventWaitHandle instance and then set the SafeWaitHandle
property. The problem with this route is that it will first create an event
object that I don't need.
2. Derive a class from WaitHandle so that I can get access to its protected
constructor which accepts a SafeWaitHandle.
Is there some other way? I was hoping there was an exposed way to create a
WaitHandle from a native event handle.
--
Thanks,
Nick
(e-mail address removed)
remove "nospam" change community. to msn.com
(FindFirstPrinterChangeNotification) which returns an event handle. I would
like to stay as much as possible in managed code so I want to get this native
event handle into a managed WaitHandle so I can call one of the WaitHandle's
Wait() methods. How do I do this?
The only way I see is to either:
1. Create an EventWaitHandle instance and then set the SafeWaitHandle
property. The problem with this route is that it will first create an event
object that I don't need.
2. Derive a class from WaitHandle so that I can get access to its protected
constructor which accepts a SafeWaitHandle.
Is there some other way? I was hoping there was an exposed way to create a
WaitHandle from a native event handle.
--
Thanks,
Nick
(e-mail address removed)
remove "nospam" change community. to msn.com