0

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!

2 Answers 2

1

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!

Sign up to request clarification or add additional context in comments.

1 Comment

Please post the code somewhere, as it will be useful to many people struggling with services.
0

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

2 Comments

Hi, i want the server logs to be continuously updated in the window so message box wont work. Anyway through which i can directly stream the logs being updated on real time basis??
If you use log4net you can write your one adapter and do the transport level by yourself (I did a UDP log4net adapter)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.