469,920 Members | 2,479 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,920 developers. It's quick & easy.

Problems with Process.Start

I am deveeloping a WinForm application where I need to display a HTML
page to the user. I would like to use IE to display this page then
wait until they have closed the IE window before continuing with the
application. Essentially, I want to make a blocking call to IE.

However, when I use the code below, I get vvariable results depending
on whether or not the process is running within the IDE or stand
alone.

ProcessStartInfo startupInfo = new ProcessStartInfo ();
startupInfo.FileName = filePath;
startupInfo.UseShellExecute = true;
startupInfo.CreateNoWindow = true;
Process process = Process.Start (startupInfo);
// For some reason, the process object is valid in the debugger but
not when running in stand alone
// Put this frig in until a suitable solution is found.
if( process != null )
{
process.WaitForExit();
}

The filePath variable is set to be the fully qualified path of the
HTML page to be displayed.

When executed within the IDE this works fine and the blocking call is
made. However, when in stand alone, the process object is null
directly after the call to Process.Start.

Can anyone explain why this is or is there a workaround?

Thanks.

Jul 21 '05 #1
0 1195

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Stephen.Haeney | last post: by
1 post views Thread by Marius Horak | last post: by
1 post views Thread by joseph micheli | last post: by
4 posts views Thread by Jesse Cates via DotNetMonster.com | last post: by
2 posts views Thread by brian.gabriel | last post: by
reply views Thread by henning.friese | last post: by
reply views Thread by Sergistm | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.