Module::RegisterCOMObject Method


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Module::RegisterCOMObject Method.

Registers one or more COM objects so other applications can connect to them.

WRL_NOTHROW virtual HRESULT RegisterCOMObject(  
   const wchar_t* serverName,  
   IID* clsids,  
   IClassFactory** factories,  
   DWORD* cookies,  
   unsigned int count);  


Fully-qualified name of a server.

An array of CLSIDs to register.

An array of IUnknown interfaces of the class objects whose availability is being published.

When the operation completes, an array of pointers to values that identify the class objects that were registered. These values are later used revoke the registration.

The number of CLSIDs to register.

S_OK if successfu; otherwise, an HRESULT such as CO_E_OBJISREG that indicates the reason the operation failed.

The COM objects are registered with the CLSCTX_LOCAL_SERVER enumerator of the CLSCTX enumeration.

The type of connection to the registered objects is specified by a combination of the current comflag template parameter and the REGCLS_SUSPENDED enumerator of the REGCLS enumeration.

Header: module.h

Namespace: Microsoft::WRL

Module Class