Article View: borland.public.cppbuilder.nativeapi
Article #15071Service error message: A stop control has been sent .........
From: Maurice Anderson
Date: Sat, 19 Jul 2003 05:13
Date: Sat, 19 Jul 2003 05:13
34 lines
1975 bytes
1975 bytes
When I try to stop the Workstation service I get the error message:
"A stop control has been sent to a service that other running services
are dependent on".
The meaning of the message seems obvious enough but my question is, is
there a way to force stop the service anyway? And in doing so, will those
dependent services continue running? If they do, will re-start the service
mess them up in anyway?
Here is the code I use to stop the service:
void __fastcall TSrvManager::StopSvc(SC_HANDLE hSCM, char *szSvcName)
{
// AnsiString MessageContent ("ERROR: COULDN'T OPEN SERVICE\n");
// MessageContent = MessageContent + szSvcName;
SC_HANDLE hService = ::OpenService(hSCM, szSvcName, SERVICE_STOP);
if (hService == NULL)
{
PrintError(GetLastError());
return;
}
SERVICE_STATUS status;
if(!::ControlService(hService, SERVICE_CONTROL_STOP, &status))
PrintError(GetLastError());
::CloseServiceHandle(hService);
QuerySvc(hSCM, szSvcName);
}
Thanks -M-
Technical Details
Message-ID:
<3f18d2c1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,d03c8933798e7fc8,start X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-18 22:16:21 PST From: "Maurice Anderson" <mauriceanderson@hotmail.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Service error message: A stop control has been sent ......... Date: Fri, 18 Jul 2003 22:13:14 -0700 Lines: 36 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 64.30.203.223 Message-ID: <3f18d2c1$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1058591425 64.30.203.223 (18 Jul 2003 22:10:25 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail