Returns the context for the current object.
HRESULT CoGetObjectContext( REFIID riid, LPVOID *ppv );
A reference to the ID of an interface that is implemented on the context object.
For objects running within COM applications, IID_IComThreadingInfo, IID_IContext, and IID_IContextCallback are available.
For objects running within COM+ applications, IID_IObjectContext, IID_IObjectContextActivity IID_IObjectContextInfo, and IID_IContextState are available.
The address of a pointer to the interface specified by riid on the context object.
This function can return the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following values.
||The object context was successfully retrieved.|
||The requested interface was not available.|
||Before this function can be called, the CoInitializeEx function must be called on the current thread.|
CoGetObjectContext retrieves the context for the object from which it is called, and returns a pointer to an interface that can be used to manipulate context properties. Context properties are used to provide services to configured components running within COM+ applications.
For components running within COM+ applications, the following interfaces are supported for accessing context properties: IObjectContext, IObjectContextActivity, IObjectContextInfo, and IContextState.
|Minimum supported client||Windows 2000 Professional [desktop apps | UWP apps]|
|Minimum supported server||Windows 2000 Server [desktop apps | UWP apps]|
|Header||combaseapi.h (include Objbase.h)|