CoRegisterClassObject(3w)

CoRegisterClassObject3w

Usage

HRESULT CoRegisterClassObject
(
REFCLSID rclsid,
LPUNKNOWN pUnk,
DWORD dwClsContext,
DWORD flags,
LPDWORD lpdwRegister
)

Overview

Registers the class object for a given class ID. Servers housed in EXE files use this method instead of exporting DllGetClassObject to allow other code to connect to their objects.

Params

rclsid [In] CLSID of the object to register.

pUnk [In] IUnknown of the object.

dwClsContext [In] CLSCTX flags indicating the context in which to run the executable.

flags [In] REGCLS flags indicating how connections are made.

lpdwRegister [In] A unique cookie that can be passed to CoRevokeClassObject.

Returns

S_OK on success, E_INVALIDARG if lpdwRegister or pUnk are NULL, CO_E_OBJISREG if the object is already registered. We should not return this.

Notes

In-process objects are only registered for the current apartment. CoGetClassObject() and CoCreateInstance(3w) will not return objects registered in other apartments.

Implementation

Declared in "objbase.h".

Implemented in "dlls/ole32/compobj.c".

Debug channel "ole".

Releases

4 releases since Debian 4.0 (Etch); the text changed 3 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7

Bugs

MSDN claims that multiple interface registrations are legal, but we can't do that with our current implementation.

From libwine-dev 1.4.1-4 in Debian 7 (Wheezy). Parsed by carta from the page's man source.