0

I have created a c++ command line application. This application sends a revives messages from other computers and logs the results to a file. A simple application. One of the first things the app does is write to the log file the start up time.

Now that I have gotten the application to a good place, I want to install it as a service that runs on my computer (win 7).

I am using the NSIS, Simple_Service_Plugin to install the application and register the service in windows. I can see the service in windows service manager.

When I attempt to start the service, I get the following error message. The log file does not get created.

Windows could not start __THE_APP__ service on Local Computer. 
Error 1053: The service did not respond to the start or control request in a timely fashion. 

When I start the app from explore it starts without any problems and the log file is updated correctly.

When I search this error message on-line I find lots of help for C# and .Net applications and nothing for c++ apps.

My question is:

  1. How do I start a C++ application (not dot.net) as a service?
Community
  • 1
  • 1
Steven Smethurst
  • 4,495
  • 15
  • 55
  • 92
  • do you need to export some function? – user877329 Mar 28 '12 at 18:04
  • You haven't written a service. You've written a standard app. You need to write a service. Start from the service template in VS. – David Heffernan Mar 28 '12 at 20:26
  • @DavidHeffernan as far as I can tell there is no "service template" in VS2010 pro. Again I am working with c++ NOT! dot.net – Steven Smethurst Mar 28 '12 at 22:37
  • looks like they took that template out of VS2010. Try creating project in older version of VS and upgrading project. Or download sample project from codeproject.com. Bottom line is you need to make a service not a standard app. – David Heffernan Mar 29 '12 at 06:17

1 Answers1

0

A service isn't a regular appliction. It's a program that uses specific system classes and implements certain features that enable the OS to communicate with it.

See here (and the surrounding pages) for more details.