Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function informs OLE that a class object, previously registered with the CoRegisterClassObjectfunction, is no longer available for use.

Syntax

HRESULT CoRevokeClassObject(
  DWORD 
dwRegister
);

Parameters

dwRegister

[in] Token previously returned from the CoRegisterClassObjectfunction.

Return Value

This function supports the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following:

S_OK

The class object was successfully revoked.

Remarks

A successful call to CoRevokeClassObjectmeans that the class object has been removed from the global class object table (although it does not release the class object).

If other clients still have pointers to the class object and have caused the reference count to be incremented by calls to IUnknown::AddRef, the reference count will not be zero. When this occurs, applications can benefit if subsequent calls (with the obvious exceptions of IUnknown::AddRefand IUnknown::Release) to the class object fail.

An object application must call CoRevokeClassObjectto revoke registered class objects before exiting the program. Class object implementers should call CoRevokeClassObjectas part of the release sequence.

Your application must specifically revoke the class object even if it has specified the flagsvalue REGCLS_SINGLEUSE in a call to CoRegisterClassObject, indicating that only one application can connect to the class object.

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

Requirements

Header objbase.h
Library ole32.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also