Article View: borland.public.cppbuilder.nativeapi
Article #9394indicating a service fails to start
From: Benjamin Pratt
Date: Fri, 09 Jul 2004 18:01
Date: Fri, 09 Jul 2004 18:01
27 lines
1855 bytes
1855 bytes
I am writing a service application using BCB6. In my ServiceStart handler, I
create a new thread. Under certain circumstances, the thread constructor
will throw an exception to indicate it cannot start (be cause a DB
connection cannot be made). In the handler I catch the exception and set
Started to false. He is the code:
void __fastcall TDynaPowerDX::ServiceStart(TService *Sender, bool &Started)
{
try
{
DataExchange = new TDataExchangeThread(false);
Started = true;
}
catch(...)
{
Started = false;
}
}
When the exception is thrown and Started is set to false, the SCM continues
to display the "attempting to start" message box for a long time. Finally a
message appears indicating 'Error 1053: The service did not respond to the
start or control request in a timely fashion.' Task manager shows that the
exe is still running. The status indicates 'starting' and the all the
options (start, stop, pause, resume, restart) are disabled.
Shouldn't the exe exit?
Technical Details
Message-ID:
<40eedd30$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6b63c33df8d56275,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Benjamin Pratt" <benjamin.pratt.getridofthis@verizon.net> Newsgroups: borland.public.cppbuilder.nativeapi Subject: indicating a service fails to start Date: Fri, 9 Jul 2004 11:01:54 -0700 Lines: 29 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: 66.245.208.182 Message-ID: <40eedd30$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089396016 66.245.208.182 (9 Jul 2004 11:00:16 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail