MsgWaitForMultipleObjects
-
Does anyone know if there are issues using this function within a dll call? I am trying to use it to wait for a global mutex handle, and it seems to never recognize that the mutex is available. If I use WaitForSingleObject(), it works fine. There are reasons for wanting to use the MsgWaitForMultipleObjects() so I cannot just shrug it off, and go with WaitForSingleObject(). Any ideas? HANDLE ghAcess; From within some function:
if (ghAccess == NULL) ghAccess = OpenMutex(MUTEX_ALL_ACCESS,FALSE,"AccessMutex"); //...This is actually within a while loop waiting about 30 seconds //this always seems to timeout: DWORD dwWaitResult = MsgWaitForMultipleObjects(1,&ghAccess,TRUE,100,QS_ALLINPUT); switch (dwWaitResult) { case WAIT_OBJECT_0: case WAIT_ABANDONED_0: return(ghAccess); default: break; }
-
Does anyone know if there are issues using this function within a dll call? I am trying to use it to wait for a global mutex handle, and it seems to never recognize that the mutex is available. If I use WaitForSingleObject(), it works fine. There are reasons for wanting to use the MsgWaitForMultipleObjects() so I cannot just shrug it off, and go with WaitForSingleObject(). Any ideas? HANDLE ghAcess; From within some function:
if (ghAccess == NULL) ghAccess = OpenMutex(MUTEX_ALL_ACCESS,FALSE,"AccessMutex"); //...This is actually within a while loop waiting about 30 seconds //this always seems to timeout: DWORD dwWaitResult = MsgWaitForMultipleObjects(1,&ghAccess,TRUE,100,QS_ALLINPUT); switch (dwWaitResult) { case WAIT_OBJECT_0: case WAIT_ABANDONED_0: return(ghAccess); default: break; }
Are you sure you are using
MsgWaitForMultipleObjects
the right way? WithbWaitAll
set toTRUE
, the function only returnsWAIT_OBJECT_0
is there is some input in the queue. Is this what you want? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Are you sure you are using
MsgWaitForMultipleObjects
the right way? WithbWaitAll
set toTRUE
, the function only returnsWAIT_OBJECT_0
is there is some input in the queue. Is this what you want? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo