Server Registration Global Functions

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

These functions provide support for registering and unregistering server objects in the object map.

System_CAPS_ICON_important.jpg Important

The functions listed in the following table cannot be used in applications that execute in the Windows Runtime.

AtlComModuleRegisterServerThis function is called to register every object in the object map.
AtlComModuleUnregisterServerThis function is called to unregister every object in the object map.
AtlComModuleRegisterClassObjectsThis function is called to register class objects.
AtlComModuleRevokeClassObjectsThis function is called to revoke class objects from a COM module.
AtlComModuleGetClassObjectThis function is called to get the class object.

This function is called to register every object in the object map.

System_CAPS_ICON_important.jpg Important

This function cannot be used in applications that execute in the Windows Runtime.

ATLINLINE ATLAPI AtlComModuleRegisterServer(
    _ATL_COM_MODULE* pComModule,
    BOOL bRegTypeLib,
    const CLSID* pCLSID);

Parameters

pComModule
Pointer to the COM module.

bRegTypeLib
TRUE if the type library is to be registered.

pCLSID
Points to the CLSID of the object to be registered. If NULL, all objects in the object map will be registered.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Remarks

AtlComModuleRegisterServer walks the ATL autogenerated object map and registers each object in the map. If pCLSID is not NULL, then only the object referred to by pCLSID is registered; otherwise all of the objects are registered.

This function is called by CAtlComModule::RegisterServer.

This function is called to unregister every object in the object map.

System_CAPS_ICON_important.jpg Important

This function cannot be used in applications that execute in the Windows Runtime.

ATLINLINE ATLAPI AtlComModuleUnregisterServer(
    _ATL_COM_MODULE* pComModule,
    BOOL bUnRegTypeLib,
    const CLSID* pCLSID);

Parameters

pComModule
Pointer to the COM module.

bUnRegTypeLib
TRUE if the type library is to be registered.

pCLSID
Points to the CLSID of the object to be unregistered. If NULL all objects in the object map will be unregistered.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Remarks

AtlComModuleUnregisterServer walks the ATL object map and unregisters each object in the map. If pCLSID is not NULL, then only the object referred to by pCLSID is unregistered; otherwise all of the objects are unregistered.

This function is called by CAtlComModule::UnregisterServer.

This function is called to register class objects.

System_CAPS_ICON_important.jpg Important

This function cannot be used in applications that execute in the Windows Runtime.

ATLINLINE ATLAPI AtlComModuleRegisterClassObjects(
    _ATL_COM_MODULE* pComModule,
    DWORD dwClsContext,
    DWORD dwFlags);

Parameters

pComModule
Pointer to the COM module.

dwClsContext
Specifies the context in which the class object is to be run. Possible values are CLSCTX_INPROC_SERVER, CLSCTX_INPROC_HANDLER, or CLSCTX_LOCAL_SERVER. See CLSCTX for more details.

dwFlags
Determines the connection types to the class object. Possible values are REGCLS_SINGLEUSE, REGCLS_MULTIPLEUSE, or REGCLS_MULTI_SEPARATE. See REGCLS for more details.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Remarks

This helper function is utilized by CComModule::RegisterClassObjects (obsolete in ATL 7.0) and CAtlExeModuleT::RegisterClassObjects.

This function is called to remove the class factory/factories from the Running Object Table.

System_CAPS_ICON_important.jpg Important

This function cannot be used in applications that execute in the Windows Runtime.

ATLINLINE ATLAPI AtlComModuleRevokeClassObjects(_ATL_COM_MODULE* pComModule);

Parameters

pComModule
Pointer to the COM module.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Remarks

This helper function is utilized by CComModule::RevokeClassObjects (obsolete in ATL 7.0) and CAtlExeModuleT::RevokeClassObjects.

This function is called to return the class factory.

System_CAPS_ICON_important.jpg Important

This function cannot be used in applications that execute in the Windows Runtime.

ATLINLINE ATLAPI AtlComModuleGetClassObject(
    _ATL_COM_MODULE* pComModule,
    REFCLSID rclsid,
    REFIID riid,
    LPVOID* ppv);

Parameters

pComModule
Pointer to the COM module.

rclsid
The CLSID of the object to be created.

riid
The IID of the requested interface.

ppv
A pointer to the interface pointer identified by riid. If the object does not support this interface, ppv is set to NULL.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Remarks

This helper function is utilized by CComModule::GetClassObject (obsolete in ATL 7.0) and CAtlDllModuleT::GetClassObject.

Functions

Show: