No changes are required to the application. Just compile it in release mode statically and start the service from SCM, it works for me (if you are administrator on your machine).
So recompile everything , restart your computer and it will work.
in the program the code to set the account is #define SERVICE_ACCOUNT L"NT AUTHORITY\\LocalService"
i found that using the LocalService account doesn't work.
It will only work if i set it to my user account but this service will also be used on other computers and i don't want to change the account properties every time (that's why using LocalService would be good if i can get it to work)
Setting the pszAccount and pszPassword variables in the call to the CreateService function (under ServiceInstaller.cpp) to "NULL" will assume that the service is to be run under the Local System account which should be just as good for most purposes.
i had the project folder saved on my desktop so using LocalService as the account, it wasn't able to find the project
but moving the folder to C: drive solved it