Convert a C++ program to a Windows service?

前端 未结 6 452
感情败类
感情败类 2020-12-01 06:40

I\'ve written a console program that \"does stuff\" - mainly using boost. How do I convert it to a Windows Service? What should I know about Windows Services beforehand?

6条回答
  •  感动是毒
    2020-12-01 07:19

    The simplest solution might be to create a new Windows Service project in Visual Studio and copy across your code to the new project.

    If you refactor your code so that you've split the UI (in this case the console) from the logic you could create a library that does the work and then call that from both the Console project and the Service Project.

提交回复
热议问题