service applications has 0 (zero) paramcount despite being started with one or more parameters
Posted on 2003-03-18
I have a small service application. I am trying to enable logging by starting the service with a particular parameter.
I find that no matter how I start the service, the paramcount is always zero. Despite this I can always get a value for paramstr(0).
Can anyone help.
Example of code....
In the ServiceStart event ...
LogMessage('paramstr(0): ' + paramstr(0), EVENTLOG_INFORMATION_TYPE, 0);
LogMessage('paramstr(1): ' + paramstr(1), EVENTLOG_INFORMATION_TYPE, 0);
LogMessage('ParamCount: ' + IntToStr(paramcount), EVENTLOG_INFORMATION_TYPE, 0);
and when the service is started with "loglevel:3" as a start parameter (using the services properties dialog ....) this produces;
paramstr(0) - <path>'\myservice.exe
paramstr(1) - nothing, empty event entry
paramcount - 0