Windows Service / Interfacing with a Client Application

G

Guest

I've developed a Windows Service that runs on a timer and performs a set of
recurring actions. I've also written a client application that controls this
service (e.g. Turn On, Off, Suspend, Restart) and allows for adjusting its
actions / parameters (ServiceController). I'd like to add the facility to
monitor the current activity of the service as well in real time when the
control application is running.

My thought was to create public properties on the Windows Service and set
them while the service is running. (e.g. MyService.CurrAction = "Starting
This, Doing That, Outputing, Waiting..) and then somehow binding my StatusBar
Text in my Control App to these properties. What I'm having trouble with is
how to reference the property of the service from my client app or notify the
client app that something has changed. For the most part, this service sits
idle. When called to action, I'd like to see the detailed activity. It
seems like the ServiceController object doesn't provide for binding to
methods/properties of the service but to merely control it.

Below it was suggested to use Remoting and I will look into that. To me
Remoting implies an external process on a different machine. Subscribing To
or Raising an Event seems to make more sense but I'm not sure if that is the
answer either.

Just looking for some direction as to how to best accomplish this task.

Ed
 
D

Dino Chiesa [Microsoft]

Remoting is a preferred mechanism for inter-process communication on a
single machine!

You could also use memory-mapped files, and a zillion other things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top