S
SunshineGirl
I'm trying to trigger an app with the following code from a message queue. It works with only the message box voilà! enabled. But it causes the exception below when it is triggered with the rest of the code. This application works fine when executed by double-clicking on the filename in Explorer. Any ideas?
public MonitorForm()
{
InitializeComponent();
try
{
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
//MessageBox.Show("Voilà!");
foreach(SHDocVw.InternetExplorer ie in shellWindows)
{
//MessageBox.Show("ie.Location:" + ie.LocationURL);
ie.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(MonitorForm.ie_BeforeNavigate2);
}
}
catch(Exception exception)
{
MessageBox.Show("InternetExplorerMonitor.exe exception.Message:" + exception.Message);
}
}
static public void ie_BeforeNavigate2(object disp, ref object url, ref object flags, ref object targetFrameName, ref object postData, ref object headers, ref bool cancel)
{
MessageBox.Show("BeforeNavigate2: " + url.ToString());
}
Exception:
COM object with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} is either not valid or not registered.
Thank you.
public MonitorForm()
{
InitializeComponent();
try
{
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
//MessageBox.Show("Voilà!");
foreach(SHDocVw.InternetExplorer ie in shellWindows)
{
//MessageBox.Show("ie.Location:" + ie.LocationURL);
ie.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(MonitorForm.ie_BeforeNavigate2);
}
}
catch(Exception exception)
{
MessageBox.Show("InternetExplorerMonitor.exe exception.Message:" + exception.Message);
}
}
static public void ie_BeforeNavigate2(object disp, ref object url, ref object flags, ref object targetFrameName, ref object postData, ref object headers, ref bool cancel)
{
MessageBox.Show("BeforeNavigate2: " + url.ToString());
}
Exception:
COM object with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} is either not valid or not registered.
Thank you.