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
  1. Home
  2. General Programming
  3. C#
  4. Distribute load to second app [modified]

Distribute load to second app [modified]

Scheduled Pinned Locked Moved C#
designtutorial
9 Posts 4 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.
  • M Offline
    M Offline
    Matglas
    wrote on last edited by
    #1

    Hy guys, I am trying to develop a lighting control application. I know that there are a lot out there but I like programming and I like lighting equipment. But I want to put my command controlling to my controller in a second app to get the load off my UI. Does anyone know how to do something like this. The command controller app needs to expose events and data. I hope someone can give me a hint or something. -- modified at 6:53 Tuesday 13th February, 2007

    M C K 3 Replies Last reply
    0
    • M Matglas

      Hy guys, I am trying to develop a lighting control application. I know that there are a lot out there but I like programming and I like lighting equipment. But I want to put my command controlling to my controller in a second app to get the load off my UI. Does anyone know how to do something like this. The command controller app needs to expose events and data. I hope someone can give me a hint or something. -- modified at 6:53 Tuesday 13th February, 2007

      M Offline
      M Offline
      miestas
      wrote on last edited by
      #2

      I'd use some preferences file or registry to store some arguments for another app. Use first one to process.start(app2); Or even create a service that will handle it, while managing preferences file/registry with gui app1.

      M 1 Reply Last reply
      0
      • M miestas

        I'd use some preferences file or registry to store some arguments for another app. Use first one to process.start(app2); Or even create a service that will handle it, while managing preferences file/registry with gui app1.

        M Offline
        M Offline
        Matglas
        wrote on last edited by
        #3

        How can you create a service and how does is work. Do you know a good article about it or something? Or example?

        M 1 Reply Last reply
        0
        • M Matglas

          Hy guys, I am trying to develop a lighting control application. I know that there are a lot out there but I like programming and I like lighting equipment. But I want to put my command controlling to my controller in a second app to get the load off my UI. Does anyone know how to do something like this. The command controller app needs to expose events and data. I hope someone can give me a hint or something. -- modified at 6:53 Tuesday 13th February, 2007

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          What you really want to do, is get a thread doing all your hardcore work, apart from your main thread, which will handle the UI

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

          M 1 Reply Last reply
          0
          • C Christian Graus

            What you really want to do, is get a thread doing all your hardcore work, apart from your main thread, which will handle the UI

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

            M Offline
            M Offline
            Matglas
            wrote on last edited by
            #5

            You totaly get it. Like a working thread. But I thought it would be better to put it in a seperate app. Maybe I can just start a thread and invoke my events from that and do it that way. The worker thread send tcp messages almost 20 times a second to the dmx controller. At least that is the rate the controller updates. I have to get his state back and I get his state by requesting it. Maybe I have to do it a different way.

            1 Reply Last reply
            0
            • M Matglas

              Hy guys, I am trying to develop a lighting control application. I know that there are a lot out there but I like programming and I like lighting equipment. But I want to put my command controlling to my controller in a second app to get the load off my UI. Does anyone know how to do something like this. The command controller app needs to expose events and data. I hope someone can give me a hint or something. -- modified at 6:53 Tuesday 13th February, 2007

              K Offline
              K Offline
              KraGiE79
              wrote on last edited by
              #6

              If you're worried about the load on your UI, you should really remove the actual implementation into a separate worker thread. In windows forms, it's best practice to use the UI for what it is, and have the actual event handlers validate the data before sending the actual processing to another thread. Remoting would be a good way to move your load off to another application, but if you need "events", you're in for a seriously rough learning curve.

              Kay Lee -Just your average coder

              M 1 Reply Last reply
              0
              • K KraGiE79

                If you're worried about the load on your UI, you should really remove the actual implementation into a separate worker thread. In windows forms, it's best practice to use the UI for what it is, and have the actual event handlers validate the data before sending the actual processing to another thread. Remoting would be a good way to move your load off to another application, but if you need "events", you're in for a seriously rough learning curve.

                Kay Lee -Just your average coder

                M Offline
                M Offline
                Matglas
                wrote on last edited by
                #7

                Well lets say I am open to learn anything. If you have any information about it I realy would like to look at it.

                1 Reply Last reply
                0
                • M Matglas

                  How can you create a service and how does is work. Do you know a good article about it or something? Or example?

                  M Offline
                  M Offline
                  miestas
                  wrote on last edited by
                  #8

                  This is a nice msdn walkthrough of creating and running windows services: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv\_vjsharp/html/vjwlkWalkthroughCreatingWindowsServiceApplicationInComponentDesignerWithVisualJ.asp As for controling another process: Process[] proc = Process.GetProcessesByName("explorer"); foreach (Process pr in proc) { pr.Kill();} this code would stop all explorer instances... and so on :) This one would start your app2: Process.Start("C:\\Path_to_your_app2\\app2.exe"); and eventually kill it: Process[] proc = Process.GetProcessesByName("app2"); foreach (Process pr in proc) { pr.Kill();} good luck and have fun. P.S. forgot to mention you nedd System.Diagnostics for this to work

                  M 1 Reply Last reply
                  0
                  • M miestas

                    This is a nice msdn walkthrough of creating and running windows services: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv\_vjsharp/html/vjwlkWalkthroughCreatingWindowsServiceApplicationInComponentDesignerWithVisualJ.asp As for controling another process: Process[] proc = Process.GetProcessesByName("explorer"); foreach (Process pr in proc) { pr.Kill();} this code would stop all explorer instances... and so on :) This one would start your app2: Process.Start("C:\\Path_to_your_app2\\app2.exe"); and eventually kill it: Process[] proc = Process.GetProcessesByName("app2"); foreach (Process pr in proc) { pr.Kill();} good luck and have fun. P.S. forgot to mention you nedd System.Diagnostics for this to work

                    M Offline
                    M Offline
                    Matglas
                    wrote on last edited by
                    #9

                    Thanks for the input. I will look at it.

                    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