Re: NT Service Problem



There is an error in your shutdown code that is causing an exception. This exception
causes the service to terminate, but it represents a bug. You will have to attach your
debugger to the service and then initiate a shutdown to see where it is failing.

What you do, in terms of db connection and threads, isn't terribly informative; all you've
really said is "my program fails, what did I do wrong?". The answer is "Yes, you did
something wrong. The solution is to find it and fix it". Without more information, such
as knowing where the fault occurs, there is no hope of saying anything more. That's what
debuggers are all about.

So the way you make the service stop successfully is to find and fix the bug.
joe

On Sun, 10 Sep 2006 07:13:02 -0700, Susanna <Susanna@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi, :)

I have an NT Service written in MFC.
There are no problems starting the service, but when I try to stop or pause
the service, I get this error 1064 i.e
"An exception occurred in the service when handling the control request"

The service is stopped but it does not return a success.

I am doing somethings (like connecting to db, starting some new threads
etc), when the service starts or is running.I believe the problem is here.

How can I make the service stop successfully??

Please reply asap.Thanks.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Choosing not to throw exceptions like IllegalArguementException
    ... preventing debug from happening at all. ... like a recipe for converting easily debugged problems into subtle wrong ... Imagine the TreeCellRenderer wich throw an exception, and prevent the JTree from any repaint success, only because some bug happened before, which broke a specific assumption, and now there is the "impossible case" happening. ...
    (comp.lang.java.programmer)
  • Re: Find rare bugs - SEH and c++ exception handling
    ... Unfortunately the bug occurs only "on the read" it's not that easy (or ... I can't introduce MessageBoxes because they ... It really seems that I neet a lot of patience. ... When the kernel detects an application exception, ...
    (microsoft.public.pocketpc.developer)
  • Re: Choosing not to throw exceptions like IllegalArguementException
    ... preventing debug from happening at all. ... like a recipe for converting easily debugged problems into subtle wrong ... Imagine the TreeCellRenderer wich throw an exception, and prevent the JTree from any repaint success, only because some bug happened before, which broke a specific assumption, and now there is the "impossible case" happening. ...
    (comp.lang.java.programmer)
  • Re: Why does this object need to be cast?
    ... >> If .NET throws an excpetion, it's a bug. ... only sew things up for which with managed code we have protection. ... writing low level classes, overiding operators and such, Exception handling ... The caller must do a silly try/catch or forward ...
    (microsoft.public.dotnet.languages.csharp)
  • Cross Thread Calls
    ... prevent the cross thread calls exception from being thrown with no ... bool success = false; ... fThreadLoadAsset = new Thread); ... fStatus = STATUS.LOADING; ...
    (microsoft.public.dotnet.csharp.general)