This topic has not yet been rated - Rate this topic

CoGetContextToken function

Applies to: desktop apps | Metro style apps

Returns a pointer to an implementation of IObjContext for the current context.

Syntax

HRESULT CoGetContextToken(
  __out  ULONG_PTR *pToken
);

Parameters

pToken [out]

A pointer to an implementation of IObjContext for the current context.

Return value

This function can return the following values.

Return codeDescription
S_OK

The token was retrieved successfully.

E_POINTER

The caller did not pass a valid token pointer variable.

CO_E_NOTINITIALIZED

The caller is not in an initialized apartment.

 

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

See also

IContext
IObjContext

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Don't release the returned pointer
Calling this function doesn't increase the internal reference count of the IObjContext object. Release()-ing the returned pointer can lead to 0xbaadfood dereferences inside ole32.dll during calls to CoCreateInstance and family.