Article View: borland.public.cppbuilder.nativeapi
Article #16214Re: Troubles with services
From: Stefano Bonifazi
Date: Tue, 27 May 2003 18:05
Date: Tue, 27 May 2003 18:05
66 lines
3882 bytes
3882 bytes
First of all Thank You very much again Mr. Gambit, I know when there's a big problem there's also the "big" Gambit to get rid of it:) You're great!! > You need to use the "Forms" namespace, not the "Svcmgr" namespace: Yes that worked!! Really I had tried with a lot of namespaces, missing the most obvious!:( > The "/install" parameter simply indicates that service executable should > call the Win32 API function CreateService() with the relavant values, and > then terminate the executable afterwards without actually running the > service. If you know all of the setup values you want to use for the > service, then you can simply all CreateService() yourself directly. I didn't use CreateService() as I thought it could be used only by the service itself when installing first (bad deduction from the Microsoft samples!:( ) > > So I thought to install it that way, and the using the > > OpenSCManager and OpenService functions to check > > the installation result > > That is another viable possibility, yes. > > > but OpenService always fails and GetLastError always > > reports ERROR_SERVICE_DOES_NOT_EXIST > > What does your exact code look like? You're most likely not passing the > service name correctly. > Thank to Your tip about using CreateService I've found what was bad: I thought that the Name property of TService was only the common TComponent::Name, but really there it hides the Service Name itself that so it's different from the DisplayName, well all the matter arose cause the Microsoft Administrator Tool for managing services under WinXP, it reports under the voice "Name" the DisplayName confusing my poor mind;( ... So some of my services worked with my code as they have the same Name as DisplayName, with the most (and with my own service!!) my code always failed!! By the way how to get their real names and not the display names??? And if it is possible how to add a description to my Service ... all the other services seems to have one, but I can't find where to put it... the Version info didn't work...!?! I would suggest You to go to work for Microsoft for a while, it would be a great loss for Borland, but maybe all of us would gain a well working Operative System:) > > Obviously I tried to change the dwDesiredAccess > > parameter, but the result does not change! > > What does your EXACT code look like? > Well I know I always should add the code to help You in finding a solution, but the matter was that I had tried with several code snippets taken from the "clean" Microsoft samples... So the problem could not be, and it was not, there!:) > Gambit I would add to Your sign: the one with the right solution to every developing problem:) Thank You very much again!! Stefano B.
Technical Details
Message-ID:
<3ed3a8c4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3ed1e176@newsgroups.borland.com> <3ed28fd7$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2bef8d34fe764e59 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-27 11:30:52 PST Reply-To: "Stefano Bonifazi" <stefboombastic@libero.it> From: "Stefano Bonifazi" <stefboombastic@libero.it> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ed1e176@newsgroups.borland.com> <3ed28fd7$1@newsgroups.borland.com> Subject: Re: Troubles with services Date: Tue, 27 May 2003 20:05:06 +0200 Lines: 69 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 212.141.199.1 Message-ID: <3ed3a8c4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054058692 212.141.199.1 (27 May 2003 11:04:52 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail