ISynchronizeContainer::WaitMultiple method (objidlbase.h)

Waits for any synchronization object in the container to be signaled or for a specified timeout period to elapse, whichever comes first.

Syntax

HRESULT WaitMultiple(
  [in]  DWORD        dwFlags,
  [in]  DWORD        dwTimeOut,
  [out] ISynchronize **ppSync
);

Parameters

[in] dwFlags

The wait options. Possible values are taken from the COWAIT_FLAGS enumeration. COWAIT_WAITALL is not a valid setting for this method.

[in] dwTimeOut

The time this call will wait before returning, in milliseconds. If this parameter is INFINITE, the caller will wait until a synchronization object is signaled, no matter how long it takes. If this parameter is 0, the method returns immediately.

[out] ppSync

A pointer to an ISynchronize interface pointer on the synchronization object that was signaled. This parameter cannot be NULL.

Return value

This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_FAIL, as well as the following values.

Return code Description
S_OK
The synchronization object was signaled.
RPC_E_TIMEOUT
The time-out period elapsed before the synchronization object was signaled.
RPC_E_NO_SYNC
There are no synchronization objects in the container.

Remarks

If the caller is waiting in a single-thread apartment, WaitMultiple enters the COM modal loop. If the caller is waiting in a multithread apartment, the caller is blocked until WaitMultiple returns.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header objidlbase.h (include ObjIdl.h)

See also

CoWaitForMultipleHandles

ISynchronizeContainer