Problem with System.Diagnostics.Process and WaitForExit

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to run the HTML help compiler from within another application.
When I get to the WaitForExit call, I get a System.InvaidOperationException
and a message "No process associated with this object." Is it just finishing
before I make the call? The process seems to finish (I have a compiled and
working help.chm).

If set StartInfo.UseShellExecute = false; I get a
System.ComponentModel.Win32Exception ("%1 is not a valid Win32 application").

//***************code snip ******************
Process myP = new Process();
myP.StartInfo.Arguments = "help.hhp";
myP.StartInfo.FileName = "hhc.exe";
myP.StartInfo.CreateNoWindow = true;
myP.Start();
myP.WaitForExit();

--

Any suggestions besides ignoring the InvalidOperationException?

Thanks
Paul
 
Back
Top