How do I wait with a time out? ManualResetEvent

  • Thread starter Thread starter Jim H
  • Start date Start date
J

Jim H

I'm using a ManualResetEvent in my library class. I need to do a wait on
the object but with a timeout. I can't block infinite. The WaitOne(int,
bool) is not supported by .netcf. How do I get around this?

jim
 
Sorry, I was mistaken. We never wrapped the Win32 event APIs into a an
EventEx class (although we had plans to do so). The Core class has PInvoke
definitions for CreateEvent, PulseEvent, SetEvent and WaitForSingleObject
 
Can I use the .NETCF ManualResetEvent with
OpenNETCF.Win32.Core.WaitForSingleObject like this?
:
Core.WaitForSingleObject(MyManualResetEvent.Handle, 1);

MyManualResetEvent.Set();

jim
 
Unfortunately no, because the handles exposed by CF classes in v1 are
obfuscated - those are internal pseudo handles
 
Ok. So, how do I clean up an event I create with CreateEvent?

I don't see a Core.CloseHandle()

Thanks again,
jim
 
[DllImport("coredll.dll", EntryPoint="CloseHandle", SetLastError=true)]
public static extern int CloseHandle(IntPtr hObject);
 
Back
Top