Article View: borland.public.cppbuilder.nativeapi
Article #16196Troubles with services
From: Stefano Bonifazi
Date: Mon, 26 May 2003 09:41
Date: Mon, 26 May 2003 09:41
24 lines
2396 bytes
2396 bytes
Hello everybody:) I'm having some troubles with services stuff, and I really can't manage to get rid of them:( First of all I'd need to get the .exe name of my service within the service itself ... of course I tried with the Application->ExeName, but the compiler complains about an ambiguity between 'Application' and 'Svcmgr::Application' , if then I put the scope resolution: Svcmgr::Application->EXEName it screams as 'ExeName is not a member of 'TServiceApplication' :( ...Any solution? Then from within another application I would like to install my service (and then starting it), but not launching it from ShellExecuteEx (or similar) with the "/INSTALL" parameter, as I would like to check if it's installed successfully! But I didn't find any useful API... So I thought to install it that way, and the using the OpenSCManager and OpenService functions to check the installation result, but OpenService always fails and GetLastError always reports ERROR_SERVICE_DOES_NOT_EXIST (by the way what's the difference with ERROR_INVALID_NAME?) ... I tried to use the couple of functions with some other services installed on my machine (WinXP, and I'm administrator!), and I always get the same result except for the "Messenger" and "Apache2" ... Obviously I tried to change the dwDesiredAccess parameter, but the result does not change!:( Please help me!!:) My best regards!! Stefano B.
Technical Details
Message-ID:
<3ed1e176@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!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2bef8d34fe764e59,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-26 02:48:27 PST Reply-To: "Stefano Bonifazi" <stefboombastic@libero.it> From: "Stefano Bonifazi" <stefboombastic@libero.it> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Troubles with services Date: Mon, 26 May 2003 11:41:05 +0200 Lines: 27 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.200.78 Message-ID: <3ed1e176@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1053942134 212.141.200.78 (26 May 2003 02:42:14 -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!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail