Distribute load to second app [modified]
-
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
-
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
-
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.
-
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
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
-
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
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.
-
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
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
-
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
-
How can you create a service and how does is work. Do you know a good article about it or something? Or example?
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
-
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