GetServiceByID method

Initializes an IOpenService object from registry settings.

Syntax

var retval = OpenServiceManager.GetServiceByID(pwzID);

Parameters

  • pwzID [in]
    Type: LPCWSTR

    The Accelerator ID returned by IOpenService::GetID.

  • ppService [out]
    Type: [IOpenService](cc849086(v=vs.85).md)

    The IOpenService interface that receives the object.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The service ID is set when the service is installed. Use IOpenService::GetID to retrieve the ID and save it to the registry or to disk for later use. The ID is unique for the lifetime of the Accelerator.

See also

OpenServiceManager

Reference

IOpenServiceManager::InstallService

IOpenServiceManager::UninstallService