CAtlServiceModuleT Class

This class implements a service.

Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

template < 
class T, 
UINT nServiceNameID  
> 
class ATL_NO_VTABLE CAtlServiceModuleT : 
public CAtlExeModuleT< T>

Parameters

  • T
    Your class derived from CAtlServiceModuleT.

  • nServiceNameID
    The resource identifier of the service.

Members

Public Constructors

Name

Description

CAtlServiceModuleT::CAtlServiceModuleT

The constructor.

Public Methods

Name

Description

CAtlServiceModuleT::Handler

The handler routine for the service.

CAtlServiceModuleT::InitializeSecurity

Provides the default security settings for the service.

CAtlServiceModuleT::Install

Installs and creates the service.

CAtlServiceModuleT::IsInstalled

Confirms that the service has been installed.

CAtlServiceModuleT::LogEvent

Writes to the event log.

CAtlServiceModuleT::OnContinue

Override this method to continue the service.

CAtlServiceModuleT::OnInterrogate

Override this method to interrogate the service.

CAtlServiceModuleT::OnPause

Override this method to pause the service.

CAtlServiceModuleT::OnShutdown

Override this method to shut down the service

CAtlServiceModuleT::OnStop

Override this method to stop the service

CAtlServiceModuleT::OnUnknownRequest

Override this method to handle unknown requests to the service

CAtlServiceModuleT::ParseCommandLine

Parses the command line and performs registration if necessary.

CAtlServiceModuleT::PreMessageLoop

This method is called immediately before entering the message loop.

CAtlServiceModuleT::RegisterAppId

Registers the service in the registry.

CAtlServiceModuleT::Run

Runs the service.

CAtlServiceModuleT::ServiceMain

The method called by the Service Control Manager.

CAtlServiceModuleT::SetServiceStatus

Updates the service status.

CAtlServiceModuleT::Start

Called by CAtlServiceModuleT::WinMain when the service starts.

CAtlServiceModuleT::Uninstall

Stops and removes the service.

CAtlServiceModuleT::Unlock

Decrements the service's lock count.

CAtlServiceModuleT::UnregisterAppId

Removes the service from the registry.

CAtlServiceModuleT::WinMain

This method implements the code required to run the service.

Public Data Members

Name

Description

CAtlServiceModuleT::m_bService

Flag indicating the program is running as a service.

CAtlServiceModuleT::m_dwThreadID

Member variable storing the thread identifier.

CAtlServiceModuleT::m_hServiceStatus

Member variable storing a handle to the status information structure for the current service.

CAtlServiceModuleT::m_status

Member variable storing the status information structure for the current service.

CAtlServiceModuleT::m_szServiceName

The name of the service being registered.

Remarks

CAtlServiceModuleT, derived from CAtlExeModuleT, implements a ATL Service module. CAtlServiceModuleT provides methods for command-line processing, installation, registering, and removal. If extra functionality is required, these and other methods can be overridden.

This class replaces the obsolete CComModule Class used in earlier versions of ATL. See ATL Module Classes for more details.

Inheritance Hierarchy

_ATL_MODULE

CAtlModule

CAtlModuleT

CAtlExeModuleT

CAtlServiceModuleT

Requirements

Header: atlbase.h

See Also

Reference

CAtlExeModuleT Class

Other Resources

ATL Class Overview