Solved

NT Service start fails

Posted on 2000-04-06
2
222 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now