Associates an execution context with a thread proxy, if it is not already associated with one.
Normally, the IThreadProxy::SwitchTo method will bind a thread proxy to an execution context on demand. There are, however, circumstances where it is necessary to bind a context in advance to ensure that the SwitchTo method switches to an already bound context. This is the case on a UMS scheduling context as it cannot call methods that allocate memory, and binding a thread proxy may involve memory allocation if a thread proxy is not readily available in the free pool of the thread proxy factory.
invalid_argument is thrown if the parameter pContext has the value NULL.