?
Solved

NT Service start fails

Posted on 2000-04-06
2
Medium Priority
?
232 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 150 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

850 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