Link to home
Start Free TrialLog in
Avatar of vetri
vetri

asked on

NT Service start fails

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
ASKER CERTIFIED SOLUTION
Avatar of xLs
xLs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Assafgo
Assafgo

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).