I want to create Windows Service (application running in background) using C/C++ language. How can I do this, can you give me a tutorial ?
A Windows service is a long-running application that can be started automatically when your system is started. You can pause your service and resume or even restart it if need be. Once you have created a Windows service, you can install it in your system using the InstallUtil.exe command line utility.
Thread object you create in the OnStart() callback. The _shutdownEvent field holds a system-level event construct that will be used to signal the thread to stop running on service shutdown. In the OnStart() callback, create and start your thread. You need a function named WorkerThreadFunc in order for this to work.
Another platform independent way is to use boost::application
Example how to use can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With