Article View: borland.public.cppbuilder.nativeapi
Article #9797Re: Using ServiceMain()
From: Arnie Mauer
Date: Tue, 08 Jun 2004 12:34
Date: Tue, 08 Jun 2004 12:34
43 lines
2456 bytes
2456 bytes
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message news:40c4b7c9$1@newsgroups.borland.com... > > "Arnie Mauer" <xxx@nowhere.net> wrote in message > news:40c4b021$1@newsgroups.borland.com... > > > I have set up two input parameters on the service's properties > > page. However, when the SCM starts the service, both input > > parameters are 0. What am I missing? > > Just to make sure first - you do know that the SCM does not remember > command-line parameters for services, don't you? Once you enter parameters > and then start a service, the parameters are lost the next time you restart > the service again. You have to re-enter the parameters every time you start > the service anew. Its design flaws such as that which made me want to write > my own SCM just to get around Microsoft's obvious shortcomings. > > > Gambit > Yes, I know that. But from the help: Parameters dwArgc Specifies the number of arguments in the lpszArgv array. lpszArgv Points to an array of pointers that point to null-terminated argument strings. The first argument in the array is the name of the service, and subsequent arguments are any strings passed to the service by the process that called the StartService function to start the service. ------------------------- I have tried setting the start parameters on the service's property page and including parameters on the ImagePath entry for the service in the registry, all to no avail. Does that mean the SCM will simply not pass parameters when starting a service? - Arnie
Technical Details
Message-ID:
<40c5b27e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40c4b021$1@newsgroups.borland.com> <40c4b7c9$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,5566683a52e317aa X-Google-Attributes: gid10cc67,public From: "Arnie Mauer" <xxx@nowhere.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <40c4b021$1@newsgroups.borland.com> <40c4b7c9$1@newsgroups.borland.com> Subject: Re: Using ServiceMain() Date: Tue, 8 Jun 2004 08:34:26 -0400 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 24.151.53.89 Message-ID: <40c5b27e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1086698110 24.151.53.89 (8 Jun 2004 05:35:10 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail