Author: greatlrd Date: Thu Jun 22 15:39:08 2006 New Revision: 22496
URL: http://svn.reactos.ru/svn/reactos?rev=22496&view=rev Log: redesign the StartProces error handling so it does not freze the gui when it start a new process. this will slov vdk freze bug.
Modified: trunk/tools/Qemu GUI/QEmu.cs trunk/tools/Qemu GUI/bin/Release/Qemu GUI.exe
Modified: trunk/tools/Qemu GUI/QEmu.cs URL: http://svn.reactos.ru/svn/reactos/trunk/tools/Qemu%20GUI/QEmu.cs?rev=22496&a... ============================================================================== --- trunk/tools/Qemu GUI/QEmu.cs (original) +++ trunk/tools/Qemu GUI/QEmu.cs Thu Jun 22 15:39:08 2006 @@ -59,12 +59,14 @@ p.StartInfo.RedirectStandardError = true; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; + p.EnableRaisingEvents = true; + p.Exited += new EventHandler(mytask_output); try { p.Start(); - m_LastError = p.StandardError.ReadToEnd(); - if (m_LastError.Length > 0) - return false; + //m_LastError = p.StandardError.ReadToEnd(); + //if (m_LastError.Length > 0) + // return false; } catch { @@ -90,12 +92,14 @@ p.StartInfo.RedirectStandardOutput = true; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; + p.EnableRaisingEvents = true; + p.Exited += new EventHandler(mytask_output); try { p.Start(); - m_LastError = p.StandardOutput.ReadToEnd(); - if (m_LastError.Length > 0) - return false; + //m_LastError = p.StandardOutput.ReadToEnd(); + //if (m_LastError.Length > 0) + // return false; } catch { @@ -114,12 +118,16 @@ p.StartInfo.RedirectStandardError = true; p.StartInfo.UseShellExecute = false; p.StartInfo.CreateNoWindow = true; + + p.EnableRaisingEvents = true; + p.Exited += new EventHandler(mytask_output); + try { p.Start(); - m_LastError = p.StandardError.ReadToEnd(); - if (m_LastError.Length > 0) - return false; + //m_LastError = p.StandardError.ReadToEnd(); + //if (m_LastError.Length > 0) + // return false; } catch { @@ -165,14 +173,18 @@ p.StartInfo.Arguments = GetArgv(); p.StartInfo.RedirectStandardError = true; p.StartInfo.UseShellExecute = false; - p.StartInfo.CreateNoWindow = true; - + p.StartInfo.CreateNoWindow = true; + + p.EnableRaisingEvents = true; + p.Exited += new EventHandler(mytask_output); + + try { p.Start(); - m_LastError = p.StandardError.ReadToEnd(); - if (m_LastError.Length > 0) - return false; + // m_LastError = p.StandardError.ReadLine(); + // if (m_LastError.Length > 0) + // return false; } catch { @@ -180,6 +192,12 @@ return false; } return true; + } + + private void mytask_output(object sender, EventArgs e) + { + Process ps = (Process)sender; + // add error handling here and do not freze the gui }
[XmlElement("Misc")] @@ -253,6 +271,8 @@ }
} + +
public class Harddisks {
Modified: trunk/tools/Qemu GUI/bin/Release/Qemu GUI.exe URL: http://svn.reactos.ru/svn/reactos/trunk/tools/Qemu%20GUI/bin/Release/Qemu%20... ============================================================================== Binary files - no diff available.