task_continuation_context::use_current Method (C++ REST SDK)

Returns a task continuation context object that represents the current execution context.

static task_continuation_context use_current();

Return Value

The current execution context.

Remarks

This method captures the caller's Windows Runtime context so that continuations can be executed in the right apartment.

The value returned by use_current can be used to indicate to the Runtime that the continuation should execute in the captured context (STA vs MTA) regardless of whether or not the antecedent task is apartment aware. An apartment aware task is a task that unwraps a Windows Runtime IAsyncInfo interface, or a task that is descended from such a task.

This method is only available to Windows Store apps.

Requirements

Header: pplxtasks.h

Namespace: pplx

See Also

Reference

task_continuation_context Class (C++ REST SDK)