Your code - as it shown in the screenshot (and next time it will be better to copy paste it as part of the question) - has nothing to do with services...
Windows services have definite rules and must be written according them...
In your case you have no service entry point, so your code can not be installed as service...
You have several options to start with:
https://msdn.microsoft.com/en-us/library/ms686953(v=vs.85).aspx[
^]
A Simple C++ Class Framework for Services[
^]
You also can use the ATL template wizard in Visual Studio to create a skeleton of a service...