Re: System.InvalidCastException : QueryInterface for interface Microsoft.ShDocVw.IWebBrowser2 failed
- From: "Matt Adamson" <Adamson_Matthew@xxxxxxxxxxx>
- Date: Mon, 29 Jan 2007 15:14:42 -0000
Any thoughts?
"Matt Adamson" <Adamson_Matthew@xxxxxxxxxxx> wrote in message
news:uuNrLiSQHHA.3996@xxxxxxxxxxxxxxxxxxxxxxx
Guys,
I'm getting this exception with the stack trace
1)
Tranmit.Sprinter.WebApp.Testing.Purchasing.Invoicing.Edit.EditInvoiceTest.EditInvoice_H_2
: System.InvalidCastException : QueryInterface for interface
Microsoft.ShDocVw.IWebBrowser2 failed.
at Microsoft.ShDocVw.InternetExplorerClass.Quit()
at Tranmit.Testing.InternetExplorerWrapper.Dispose(Boolean
disposeManagedComponents)
at Tranmit.Testing.InternetExplorerWrapper.Dispose()
at
Tranmit.Sprinter.WebApp.Testing.Purchasing.Invoicing.Edit.EditInvoiceTest.EditInvoice_H_2()
Which is thrown from code such as this
if( ! this.disposed )
{
if(disposeManagedComponents)
{
ClearNewIeWindows();
if(InternetExplorer != null)
{
if(
Convert.ToBoolean(ConfigurationSettings.AppSettings["WebBrowserQuitOnDispose"])
==
true)
{
InternetExplorer.Quit();
}
}
}
// Release unmanaged resources. If disposing is false,
if(internetExplorer != null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(internetExplorer);
}
}
disposed = true;
}
In the dispose implementation of a wrapper IE class which simply wraps
calls to the InternetExplorer object which is of type
/// <summary>
/// IE object managed by this class
/// </summary>
private InternetExplorer internetExplorer = new
Microsoft.ShDocVw.InternetExplorerClass();
Any ideas why I should get this randomly?
.
- References:
- Prev by Date: How to put line feed into preformatted PRE element?
- Next by Date: Strange NewWindow2 behaivior
- Previous by thread: System.InvalidCastException : QueryInterface for interface Microsoft.ShDocVw.IWebBrowser2 failed
- Next by thread: Re: WebBrowser Control Document Object
- Index(es):
Loading