Windows Service Interaction
-
I have written a Windows Service application in C# that works and is controlled by a separate C# tray application. The service queues up and processes a list of files from a specified directory. I would like to be able to get the current list on a regular basis using a timer from the tray application so I can report to the user the current processing status. I know that I can override the OnCustomCommand method in my service and call that through a servicecontroller on the tray app, however, this method returns void so I can't use it to get back the list currently being processed. Does anyone know if there is a simple way I can share data between the two applications? Thanks. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall
-
I have written a Windows Service application in C# that works and is controlled by a separate C# tray application. The service queues up and processes a list of files from a specified directory. I would like to be able to get the current list on a regular basis using a timer from the tray application so I can report to the user the current processing status. I know that I can override the OnCustomCommand method in my service and call that through a servicecontroller on the tray app, however, this method returns void so I can't use it to get back the list currently being processed. Does anyone know if there is a simple way I can share data between the two applications? Thanks. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall
perlmunger wrote:
The service queues up and processes a list of files
If the processing occurs at sufficiently large time intervals, perhaps the service could keep its last valid status in a file known to the tray app? /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com
-
perlmunger wrote:
The service queues up and processes a list of files
If the processing occurs at sufficiently large time intervals, perhaps the service could keep its last valid status in a file known to the tray app? /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com
Ravi, Thanks for the suggestion. I've thought of that and will implement it if need be, however, I was hoping to avoid any IO (disk or otherwise). Even if I could just pass a long comma-delimited string between processes it would be nice. I don't need it to pass some complex data type. Thanks again. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall
-
I have written a Windows Service application in C# that works and is controlled by a separate C# tray application. The service queues up and processes a list of files from a specified directory. I would like to be able to get the current list on a regular basis using a timer from the tray application so I can report to the user the current processing status. I know that I can override the OnCustomCommand method in my service and call that through a servicecontroller on the tray app, however, this method returns void so I can't use it to get back the list currently being processed. Does anyone know if there is a simple way I can share data between the two applications? Thanks. -Matt ------------------------------------------ The 3 great virtues of a programmer: Laziness, Impatience, and Hubris. --Larry Wall
OnCustomCommand is very limited. If you want more functionality you need to use IPC ( InterProcess Communication ). I suggest you have a look at remoting. ---------------------------- Be excellent to each other :)