C# CreateProcess for an IE URL fails on 64bit

Add-in Express™ Support Service
That's what is more important than anything else

C# CreateProcess for an IE URL fails on 64bit
 
Rabbit


Guest


In C# VS2010.NET I have:

try
{
   string ieFullPath = System.IO.Path.Combine(Environment.GetFolderPath(
      Environment.SpecialFolder.ProgramFiles), "Internet Explorer\iexplore.exe");
   if (File.Exists(ieFullPath))
   {  
      this.CreateProcess(""" + ieFullPath + "" "" + updatePage + """);
      MessageBox.Show("A Run");
   }
}
catch
{
   MessageBox.Show("A Fail");
}
try
{
   string ieFullPathX86 = System.IO.Path.Combine(Environment.GetFolderPath(
      Environment.SpecialFolder.ProgramFilesX86), "Internet Explorer\iexplore.exe");
   if (File.Exists(ieFullPath))
   {  
      this.CreateProcess(""" + ieFullPathX86 + "" "" + updatePage + """);
      MessageBox.Show("B Run");
   }
}
catch
{
   MessageBox.Show("B Fail"); 
}


I added in alerts and can see that both of the CreateProcess calls do run and neither of them causes an exception, yet on 64-bit Windows neither actually open a web page. Since neither throw an exception I also cannot 'detect' in the code that the problem occurred in order to show a suitable error message to the user, I can only see it when testing.

How can I enable the process of opening a web page so that it will work under 32-bit and 64-bit machines please? As the latter does not work for me at the moment.
Posted 02 Mar, 2011 06:56:45 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Rabbit,

You can use the Navigate method of the IE object model to open an url in a separate IE window or tab.
Posted 02 Mar, 2011 07:10:22 Top