Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

CoSwitchCallContext

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This function switches the call context object used by CoGetCallContext.


HRESULT CoSwitchCallContext(
  IUnknown* pNewObject,
  IUnknown** ppOldObject
);

pNewObject

[in] A pointer to an interface on the new call context object.

COM will keep a reference to the pointer until CoSwitchCallContext is called with another object.

It may be NULL if your application is calling CoSwitchCallContext to switch back to the original call context and there was no original call context.

ppOldObject

[out] Address of pointer variable that receives a pointer to the call context object of the call currently in progress.

This value is returned so that the original call context can be restored by the custom marshaler.

The returned pointer will be NULL if there was no call in progress.

S_OK

Success.

E_OUT_OF_MEMORY

There is insufficient memory to complete this operation.

Custom marshalers call CoSwitchCallContext to change the call context object used by CoGetCallContext.

Before dispatching an arriving call, custom marshalers call CoSwitchCallContext, specifying the new context object.

After sending a reply, they must restore the original call context by calling CoSwitchCallContext again, this time passing a pointer to the original context object.

Call context objects provided by custom marshalers should support IServerSecurity.

To determine whether the platform supports this function, see Determining Supported COM APIs.

Headerobjbase.h
Libraryole32.lib
Windows Embedded CEWindows CE 3.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions

Show:
© 2015 Microsoft