Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Windows Service Interaction

Windows Service Interaction

Scheduled Pinned Locked Moved C#
csharpquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    perlmunger
    wrote on last edited by
    #1

    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

    RaviBeeR N 2 Replies Last reply
    0
    • P perlmunger

      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

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      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

      P 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        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

        P Offline
        P Offline
        perlmunger
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • P perlmunger

          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

          N Offline
          N Offline
          Nicholas Butler
          wrote on last edited by
          #4

          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 :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups