COM
Expand Minimize

CoRevokeClassObject function

Informs OLE that a class object, previously registered with the CoRegisterClassObject function, is no longer available for use.

Syntax


HRESULT CoRevokeClassObject(
  _In_  DWORD dwRegister
);

Parameters

dwRegister [in]

A token previously returned from the CoRegisterClassObject function.

Return value

This function can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, and E_UNEXPECTED, as well as the following values.

Return codeDescription
S_OK

The class object was revoked successfully.

 

Remarks

A successful call to CoRevokeClassObject means 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 may benefit if subsequent calls (with the obvious exceptions of AddRef and IUnknown::Release) to the class object fail. Note that CoRegisterClassObject calls AddRef and CoRevokeClassObject calls Release, so the two functions form an AddRef/Release pair.

An object application must call CoRevokeClassObject to revoke registered class objects before exiting the program. Class object implementers should call CoRevokeClassObject as part of the release sequence. You must specifically revoke the class object even when you have specified the flags value REGCLS_SINGLEUSE in a call to CoRegisterClassObject, indicating that only one application can connect to the class object.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Objbase.h

Library

Ole32.lib

DLL

Ole32.dll

See also

CoGetClassObject
CoRegisterClassObject

 

 

Community Additions

ADD
Show:
© 2014 Microsoft