Server Registration Global Functions
These functions provide support for registering and unregistering server objects in the object map.
Important
The functions listed in the following table cannot be used in applications that execute in the Windows Runtime.
Name | Description |
---|---|
AtlComModuleRegisterServer | This function is called to register every object in the object map. |
AtlComModuleUnregisterServer | This function is called to unregister every object in the object map. |
AtlComModuleRegisterClassObjects | This function is called to register class objects. |
AtlComModuleRevokeClassObjects | This function is called to revoke class objects from a COM module. |
AtlComModuleGetClassObject | This function is called to get the class object. |
Header: atlbase.h
This function is called to register every object in the object map.
ATLINLINE ATLAPI AtlComModuleRegisterServer(
_ATL_COM_MODULE* pComModule,
BOOL bRegTypeLib,
const CLSID* pCLSID);
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.
Returns S_OK on success, or an error HRESULT on failure.
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.
ATLINLINE ATLAPI AtlComModuleUnregisterServer(
_ATL_COM_MODULE* pComModule,
BOOL bUnRegTypeLib,
const CLSID* pCLSID);
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.
Returns S_OK on success, or an error HRESULT on failure.
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.
ATLINLINE ATLAPI AtlComModuleRegisterClassObjects(
_ATL_COM_MODULE* pComModule,
DWORD dwClsContext,
DWORD dwFlags);
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.
Returns S_OK on success, or an error HRESULT on failure.
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.
ATLINLINE ATLAPI AtlComModuleRevokeClassObjects(_ATL_COM_MODULE* pComModule);
pComModule
Pointer to the COM module.
Returns S_OK on success, or an error HRESULT on failure.
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.
ATLINLINE ATLAPI AtlComModuleGetClassObject(
_ATL_COM_MODULE* pComModule,
REFCLSID rclsid,
REFIID riid,
LPVOID* ppv);
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.
Returns S_OK on success, or an error HRESULT on failure.
This helper function is utilized by CComModule::GetClassObject (obsolete in ATL 7.0) and CAtlDllModuleT::GetClassObject.