Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a RPC server & client written in c++. I have .exe for both of them. When i tried to create a service from those exe(using sc create) the service is getting created but its not starting. It shows the error message -"The service did not respond to the start or control request in a timely fashion?" I googled the stuff and increased the timeout period but it also did not worked. Atlast i created the service using "Always Up" software and it worked just fine. Any idea what I can do to solve the problem using sc create?
(N.B-The service is created from the exe file which does not have any onstart or onstop methods unlike the services created from windows service template )
Posted

It is often a dll problem. Some missing dlls for your module. Not a release build? Another problem are also rights: the service needs often admin rights to run.

Tip: You can debug the service via building it to the install destination and than run it on the debugger.
 
Share this answer
 
i think you misunderstand services and sc

sc create makes the registry changes necessary to run a properly compiled windows service.exe, it does *nothing* to create that service.exe for you

you can't just make a normal exe run as a service (alwaysUp is cheating because *it* runs as a service and simply spawns your exe)

And please don't ask the same question repeatedly - The service did not respond to the start or control request in a timely fashion?[^]
 
Share this answer
 
Comments
Somesh Dhal 19-Aug-15 6:47am    
Can you provide any links that explains how to create a windows service in c++?
barneyman 19-Aug-15 7:52am    
no, but i can google

https://www.google.com.au/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=c%2B%2B%20windows%20service&es_th=1

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900