Yep, check myP.HasExited before running WaitForExit.
--
John Wood
Blog:
http://dotnetjunkies.com/weblog/johnwood
"PaulFir509" <Pa********@discussions.microsoft.com> wrote in message
news:BF**********************************@microsof t.com...
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