Wait Method
Collapse the table of content
Expand the table of content

ISynchronize::Wait method

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

Syntax


HRESULT Wait(
  [in] DWORD dwFlags,
  [in] DWORD dwMilliseconds
);

Parameters

dwFlags [in]

The wait options. Possible values are taken from the COWAIT_FLAGS enumeration.

dwMilliseconds [in]

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

Return value

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

Return codeDescription
S_OK

The synchronization object was signaled.

RPC_E_CALLPENDING

The time-out period elapsed before the synchronization object was signaled.

 

Remarks

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

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

ObjIdl.h

IDL

ObjIdl.idl

IID

IID_ISynchronize is defined as 00000030-0000-0000-C000-000000000046

See also

CoWaitForMultipleHandles
ISynchronize

 

 

Show:
© 2016 Microsoft