I have a little application that opens a browser window from a windows application built using VS2005.
Added references for Microsoft.mshtml and interop.shdocvw.
Then created a browser class:
public class StaticBrowser
public static IWebBrowser2 TheInstance = new InternetExplorerClass()
Next used the following code in a menu click to open a browser window:
private void staticBrowserToolStripMenu
object missing = System.Reflection.Missing.
ref missing, ref missing, ref missing, ref missing);
Visible = true;
This is all fine and the browser window opens - if I click the menu item again the same browser window is used and you can see it re-display - the same window.
The problem is if the user closes the browser window that was open the following error happens when the user clicks the menu item again to open the browser window.
ception (0x80010108): The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
Is there any way to bring up this window again - I know I can use a non static Browser but that results in a new window with every click which is something I was trying to avoid.