Vcl.SvcMgr.TService.GetServiceController

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetServiceController: TServiceController; virtual; abstract;

C++

virtual LPHANDLER_FUNCTION __fastcall GetServiceController() = 0 ;

Properties

Type Visibility Source Unit Parent
function public
Vcl.SvcMgr.pas
Vcl.SvcMgr.hpp
Vcl.SvcMgr TService

Description

Returns the service's registered handler function.

GetServiceController returns the handler for the service. You do not need to call this function directly. The service object's main function calls it automatically.

Note: Each service in the service application has a main function for that service. When a request is made to start the service, the main thread of the service calls the RegisterServiceCtrlHandler function to register this control handler function. TService automatically calls RegisterServiceCtrlHandler and returns this handler function. Because this function cannot be a class method (member function), the Service application wizard generates code that creates a non-member handler, (ServiceController) for your service object. This routine returns the service object's Handler (Controller).