[DllImport("ole32.dll")]
static extern int CoWaitForMultipleHandles(uint dwFlags, uint dwTimeout,
uint cHandles, IntPtr [] pHandles, out uint lpdwindex);
None.
None.
This should be called as part of a long running process in Excel VSTO add-ins, for example.
System.Threading.ManualResetEvent event = new System.Threading.ManualResetEvent(false);
System.IntPtr[] waitHandles = { event.SafeWaitHandle.DangerousGetHandle() };
uint lpdwindex;
while(/* Put condition here! */)
{
// Lots of work!!!
CoWaitForMultipleHandles(0, 0, (uint)waitHandles.Length, waitHandles, out lpdwindex);
}
Do you know one? Please contribute it!