Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two applications, one Windows Service, second Windows Forms application. What would be the best way to send a message (its a small string 10 character length) from Windows Service to Windows Forms.

Any simple approach is highly appreciated.

Thanks,
Kishore
Posted

You might use common storage to update this. Place your data in Registry / diskfile or whereever you want, and access it from both the process. This is the easiest.

Other than that, you might also use Named Pipes to send messages between two processes. Read this :

http://www.switchonthecode.com/tutorials/interprocess-communication-using-named-pipes-in-csharp[^]
http://www.codeguru.com/Csharp/Csharp/cs_network/remoting/article.php/c7259/[^]

;)
 
Share this answer
 
I think the simplest would be to have a function in your form that queries the service, and returns the value.

You can put it in a thread, or a timer.

I Agree With Answer 2.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900