Process.Start("mailto:abc@yahoo.com")
-
Hi All, I am calling below code in installer class it is giving exception.System.Diagnostics.Process.Start("mailto:abc@yahoo.com")."The requested lookup key was not found in any active activation context". But the above line of code is working fine by opening a Outlook Express New MailMessage window,when i called from a button click event in a windows form.But when i try to call it frominstaller class its giving exception. Any body have idea please reply back. Thanks in advance. Sastry. Sastry
-
Hi All, I am calling below code in installer class it is giving exception.System.Diagnostics.Process.Start("mailto:abc@yahoo.com")."The requested lookup key was not found in any active activation context". But the above line of code is working fine by opening a Outlook Express New MailMessage window,when i called from a button click event in a windows form.But when i try to call it frominstaller class its giving exception. Any body have idea please reply back. Thanks in advance. Sastry. Sastry
Please see this recent MSDN article, in particular, scroll down 3/4ths of the way down the page and you'll see the exact problem you're describing:
Process::Start("http://www.microsoft.com");
Alas, if you try this at home, the same thing happens. The call throws a Win32Exception which yields an even more cryptic code in its NativeErrorCode property: ERROR_SXS_KEY_NOT_FOUND. The description for this error is "The requested lookup key was not found in any active activation context." Huh? If you poke around the documentation for Process and read all the fine print, you'll discover that Process uses something called StartInfo in order to tell it how to start the process. One of the properties in StartInfo is UseShellExecute. By default, UseShellExecute equals True, which tells the Framework to launch the process using the shell, that is, ShellExecuteEx. Okay, so try setting it to False. But then, as the fine print explains, you can only start EXEs, not file names or URLs. The article mentions some other options, such as using rundll32, to launch your URL.Tech, life, family, faith: Give me a visit. I'm currently blogging about: Hallelujah! It's Ken Jennings! Judah Himango