Solved

NT Service start fails

Posted on 2000-04-06
2
226 Views
Last Modified: 2010-04-02
I have a VC++ console application (NT service enabled). It has been installed successfully as a service. When try to launch it from the control panel, I got the error "Error # 1067. The process terminated unexpectedly".
Can somebody tell me, whythis happens so ?

Thanx,
/vetri
0
Comment
Question by:vetri
2 Comments
 
LVL 2

Accepted Solution

by:
xLs earned 50 total points
ID: 2691845
you are probably exiting in your run Proc, you can not exit that proc, do that only when you get a Stop signal.

0
 
LVL 1

Expert Comment

by:Assafgo
ID: 2726482
I don't know if you understood xLs answer (It was tough for me either), but he is right.
What is happening is that the Services tool in the Conrtol Panel does not have a 'refresh' so the buttons represent only the operations on the service done through it (start, stop, pause...)
they become aware of it when you push a button and discover that its not the right state.
What you could do, if you MUST exit from within the process, do it calling the handler function with Stop flag in order to do it cleanly.
it will still not notify the Services user interface, but the message will be more subtle (something like 'The process is already stopped).

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question