home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Executing an external application....and getting its output
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="egonspengleruk" data-source="post: 55434" data-attributes="member: 13482"><p>Found the following example...<a href="http://msdn2.microsoft.com/en-us/system.diagnostics.process.exited.aspx" target="_blank">http://msdn2.microsoft.com/en-us/system.diagnostics.process.exited.aspx</a></p><p></p><p>Cant work out how the process in this example knows to call myProcess_Exited when its finished. How do I add this event handler to my code?</p><p></p><p>And your idea with enum's....is that a better way than in the example above ?</p><p></p><p>I was thinking my code would become</p><p>[code]</p><p>ConvertProcess.StartInfo.FileName = BurnerFilesPath + "mpgtx.exe";</p><p> ConvertProcess.StartInfo.Arguments = "-f -d \"" + FilePathsToBurn[i] + "\" -b \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "\" ";</p><p> </p><p> ConvertProcess.Start();</p><p> //ConvertProcess.WaitForExit();</p><p> </p><p> while (!eventHandled)</p><p> {</p><p> Thread.Sleep(SLEEP_AMOUNT);</p><p> }[/code]</p><p></p><p>and eventHandled would be set in </p><p></p><p>[code] private void myProcess_Exited(object sender, System.EventArgs e)</p><p> {</p><p> eventHandled = true;</p><p> }[/code]</p><p></p><p>but it never calls this in my code so I get stuck in a forever loop.</p><p></p><p>Any ideas?</p><p></p><p>Cheers for all your help on this one !</p><p></p><p>Egon</p></blockquote><p></p>
[QUOTE="egonspengleruk, post: 55434, member: 13482"] Found the following example...[url]http://msdn2.microsoft.com/en-us/system.diagnostics.process.exited.aspx[/url] Cant work out how the process in this example knows to call myProcess_Exited when its finished. How do I add this event handler to my code? And your idea with enum's....is that a better way than in the example above ? I was thinking my code would become [code] ConvertProcess.StartInfo.FileName = BurnerFilesPath + "mpgtx.exe"; ConvertProcess.StartInfo.Arguments = "-f -d \"" + FilePathsToBurn[i] + "\" -b \"" + strTempFolder + "\\" + FileNamesToBurn[i] + "\" "; ConvertProcess.Start(); //ConvertProcess.WaitForExit(); while (!eventHandled) { Thread.Sleep(SLEEP_AMOUNT); }[/code] and eventHandled would be set in [code] private void myProcess_Exited(object sender, System.EventArgs e) { eventHandled = true; }[/code] but it never calls this in my code so I get stuck in a forever loop. Any ideas? Cheers for all your help on this one ! Egon [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Executing an external application....and getting its output
Contact us
RSS
Top
Bottom