Re: SVCOM - anyone know how to pass a command-line parameter?
- From: "Remy Lebeau \(TeamB\)" <no.spam@xxxxxxxxxxx>
- Date: Wed, 28 Nov 2007 11:33:51 -0800
"Arthur Hoornweg" <antispam.hoornweg@xxxxxxxxxxxxx> wrote in message
news:474d6845$1@xxxxxxxxxxxxxxxxxxxxxxxxx
I need to pass a command-line parameter to one of my
services when it starts but I can't find how.
There are only three ways I know for a service to receive startup
parameters:
1) when starting the service inside the SCM's UI, go into the service's
Properties dialog and use the "Start parameters" field. This is on a
per-start basis, though, as the dialog does not remember the parameters from
one start to the next.
2) when starting the service from code, the StartService() function has
dwNumServiceArgs and lpServiceArgVectors parameters.
#1 and #2 both pass the parameters to the service's ServiceMain()
callback, which I assume SvCom then exposes in its Params() property
(Borland's TService does).
3) in the Registry key for the service, you can add command-line parameters
to the "ImagePath" value (for example, Microsoft's "Alerter" service does
this).
To retreive these parameters, you need to access the process's
command-line via the Win32 API GetCommandLine() function or the VCL's
ParamStr() function. This is not the same thing as using service startup
parameters above.
4) in the Registry, add a "Parameters" subkey to the service's key (or store
the values anywhere else you want) and then have the service read the values
manually when needed.
Gambit
.
- References:
- SVCOM - anyone know how to pass a command-line parameter?
- From: Arthur Hoornweg
- SVCOM - anyone know how to pass a command-line parameter?
- Prev by Date: Re: SVCOM - anyone know how to pass a command-line parameter?
- Next by Date: Re: ANNOUNCING ElasticForm 10 (Form Sizer)
- Previous by thread: Re: SVCOM - anyone know how to pass a command-line parameter?
- Next by thread: Re: SVCOM - anyone know how to pass a command-line parameter?
- Index(es):
Relevant Pages
|
|