exception when starting a process

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

Guest

Hi all,

I am trying to launch a URL in a browser window using Process.Start(). From
my mainline, before I call Application.Run when I try and do this I get the
following exception:

Exception: System.ComponentModel.Win32Exception
The requested lookup key was not found in any active activation context

Later, when I try and launch the webpage from a context menu item on my main
form it works fine (both times I am using the same method).

All I'm doing is the following:
System.Diagnostics.Process.Start( theUrl );

Any ideas?

Thanks,
Ben
 
Hi Ben,
I am trying to launch a URL in a browser window using Process.Start(). From
my mainline, before I call Application.Run when I try and do this I get the
following exception:

Exception: System.ComponentModel.Win32Exception
The requested lookup key was not found in any active activation context

You may try Application.OleRequired() before Process.Start().

bye
Rob
 
Not sure what you mean by that.

If I do the following, it works:

ProcessStartInfo startInfo = new ProcessStartInfo( "IExplore.exe" );
startInfo.Arguments = theUrl;
Process.Start( startInfo );

But of course that launches IE and not the system default browser.

--Ben
 
Hi Ben,
No luck. I still get the same exception.

I also have some strange Process.Start problems, unfortunately
after Application.Run.

By any chance, are you embedding a web browser in your app?
I suspect that's the source of the problems, but I never get
a confirmation from other developers.

bye
Rob
 
Back
Top