UtilFormsForceMessageQueuePump Method

This method allows the current thread to perform long-running operations while continuing to perform standard COM and SendMessage pumping.

Calling this method during a long-running operation will prevent the Managed Debugging Assistant (MDA) 'ContextSwitchDeadlock' error to occur while debugging your solution.

This error may occur when the thread that owns the destination context/apartment is processing a very long-running operation without pumping Windows messages for a specific period of time.

For example, you will use this method while performing a long-running operation with COM objects (eg. inside a "infinite" loop) that is blocking the UI thread,

so it is unabling the UI thread to pump window messages as they arrive, causing the 'ContextSwitchDeadlock' error to occur in the Visual Studio debugger after 60 seconds.

Definition

Namespace: DevCase.Core.Application.Forms
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static void ForceMessageQueuePump()

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

See Also