ServiceParameters

When an object is written as a Win32 service and installed for use by OLE through setting the LocalService413V_S_ named value under the AppIDBQF3ZC key, the ServiceParameters named-value can be set to pass the given parameter on the command line when the service is launched.

Registry Entry

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\APPID\
                                    AppID_value}\ServiceParameters = parameter

Remarks

The parameter value for the ServiceParameters named-value is any REG_SZ string value. This string is passed on the command line to the service as it is being launched.

For example, the following keys register the c:\mydb\mydb.exe executable to launch as the MyDatabase service when activated remotely. When launched as a service, the process receives  -Service  on its command-line.

HKEY_CLASSES_ROOT\APPID\{ c5b7ac20-523f-11cf-8117-00aa00389b71}\LocalService = MyDatabase

 

HKEY_CLASSES_ROOT\APPID\{ c5b7ac20-523f-11cf-8117-00aa00389b71}\ServiceParameters = -Service

 

Refer to the Win32 SDK documentation about services and the SECSVR sample Distributed COM application for more information about writing, installing, and debugging Win32 services.

See Also

LocalService, Registering COM Servers