When i double click on my server exe it runs as a console application and i can see the logs in console.
I have made a windows service using the code given at http://code.msdn.microsoft.com/windowsdesktop/CppWindowsService-cacf4948
Using this the server runs in background but i cant see the console. Can anyone tell me how can i send messages to the console from a service??
Thanks!
Got it! I print my logs from my service to a pipe handle and i just wrote a simple pipe client which reads the file and displays it in the console.
If anyone needs the code then ill post it here
Thanks!
Starting from Windows Vista the services are executed in a different session so most communications will not work.
http://msdn.microsoft.com/en-us/library/windows/hardware/gg463353.aspx
Microsoft have some ways to communicate with services as described here (only first paragraph).
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683502%28v=vs.85%29.aspx