Partager via


IVsCommonMessagePump.ModalWaitForObjects(IntPtr[], UInt32, UInt32) Method

Definition

Use this method to wait for objects to signal (likely by some background processing) while keeping VS responsive.

public:
 int ModalWaitForObjects(cli::array <IntPtr> ^ rgHandles, System::UInt32 cHandles, [Runtime::InteropServices::Out] System::UInt32 % pdwWaitResult);
public int ModalWaitForObjects (IntPtr[] rgHandles, uint cHandles, out uint pdwWaitResult);
abstract member ModalWaitForObjects : nativeint[] * uint32 * uint32 -> int
Public Function ModalWaitForObjects (rgHandles As IntPtr(), cHandles As UInteger, ByRef pdwWaitResult As UInteger) As Integer

Parameters

rgHandles

IntPtr[]

nativeint[]

The array containing the handles of the objects to wait on.

cHandles
UInt32

The number of handles in the array. The maximum is 64.

pdwWaitResult
UInt32

[out] The result that is set when the wait condition was met (i.e., when the method returned S_OK):WAIT_OBJECT_0 to (WAIT_OBJECT_0 + cHandles - 1) indicates the signaled object (applies only when fWaitForAllObjects is false).WAIT_OBJECT_0 if fWaitForAllObjects was true.WAIT_TIMEOUT the time-out interval elapsed before the condition specified by fWaitForAllObjects was met.

Returns

S_OK if the wait condition was met; the pdwWaitResult parameter will contain more information about the wait result. Returns E_PENDING if the method had to quit because the user cancelled the wait operation. E_ABORTif WM_QUIT was received.

Remarks

This is the preferred method to use in this interface. It does not require the consumer to implement anything. The method automatically puts the IDE in a modal state, which reduces the risk of reentrancy. The method also handles displays the default UI that explains the reason for the wait. This wait UI is shown roughly 2 seconds after the wait has been initiated.

Applies to