2

I have a native c++ application which is the server for my game. I currently have it as a scheduled task on my server,. but it really should be a service from what I read.

Is there away in Visual Studio 2008 to compile as a service instead of a console app?

I don't need to see the console window, the app logs everything to a file.

Thanks

jmasterx
  • 52,639
  • 96
  • 311
  • 557

1 Answers1

2

As far as I know, you can't "compile it as a service" by changing compiler options, you'll have to change the code of you app (to start with, services don't use "main" but "ServiceMain" as an entry point...)

Possible duplicate of: Convert a C++ program to a Windows service?.

Maybe the easiest way to achieve what you want without chaning your program is to use a "service wrapper", a special kind of program which can run your console program as as a service. One of the most known is srvany from the Microsoft Resource kit, but there are also alternatives (like e.g. nssm)

Community
  • 1
  • 1
Nikolay
  • 10,752
  • 2
  • 23
  • 51