21

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 ?

TN888
  • 7,659
  • 9
  • 48
  • 84
  • 3
    There's not C/C++ language. There are two languages, C and C++, which just happen to have an above-average degree of interoperability. – MSalters Sep 01 '13 at 20:19
  • 6
    @MSalters I know that are different languages. I mean that I will do that in C **or** C++ . My solution is designed for that both langs. – TN888 Sep 01 '13 at 20:21
  • It compiles in VC++, but a C++ programmer would use a class to encapsulate the service. That's just one example of the different idioms with C++. In fact, a C++ programmer would probably separate generic implementation in a base `Service` class and put specifics in a derived class. – MSalters Sep 02 '13 at 06:50
  • @MSalters that works propely, I know that there are other possibilities, but I am using it as the best. – TN888 Sep 02 '13 at 07:12

1 Answers1

1

Another platform independent way is to use boost::application

Example how to use can be found here.

Sergei Nikulov
  • 5,029
  • 23
  • 36