Normal
Found the following example...http://msdn2.microsoft.com/en-us/system.diagnostics.process.exited.aspxCant 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
Found the following example...http://msdn2.microsoft.com/en-us/system.diagnostics.process.exited.aspx
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;
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