![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, I wanted to use WaitForMultipleObjects in C#. Following is the code: [DllImport("kernel32.dll", SetLastError=true)] static extern int WaitForMultipleObjects ( int nCount, ref IntPtr []lpHandles, int bWaitAll, uint dwMilliseconds); ... IntPtr []HandleArray = new IntPtr[2]; HandleArray[0] = (IntPtr)m_iStopEventHandle; HandleArray[1] = (IntPtr)m_iTimerHandle; int iRet = WaitForMultipleObjects(2, ref HandleArray, 1, INFINITE); ... I am getting -1 (Invalid handle) as the return value. If I use the 2 handles( m_iStopEventHandle and m_iTimerHandle) then WaitForMultipleObjects works fine. Please let me know if I am doing anything wrong with the pinvoke. Thanks in advance. nachiket |
#3
| |||
| |||
|
#4
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |