CAtlServiceModuleT::ServiceMain

This method is called by the Service Control Manager.

void ServiceMain( 
   DWORD dwArgc, 
   LPTSTR* lpszArgv  
) throw( );

Parameters

  • dwArgc
    The argc argument.

  • lpszArgv
    The argv argument.

Remarks

The Service Control Manager (SCM) calls ServiceMain when you open the Services application in the Control Panel, select the service, and click Start.

After the SCM calls ServiceMain, a service must give the SCM a handler function. This function lets the SCM obtain the service's status and pass specific instructions (such as pausing or stopping). Subsequently, CAtlServiceModuleT::Run is called to perform the main work of the service. Run continues to execute until the service is stopped.

Requirements

Header: atlbase.h

See Also

Reference

CAtlServiceModuleT Class