Wednesday, March 22, 2006

Windowless Activex Controls are not Supported!

Add a WebBrowser Control to a user control with VS2003 and .NET v1.1 and when you close the application if you haven't closed it you'll get this oh so convenient exception thrown.

Pete Davis has the answer here.

protected override void Dispose( bool disposing )
{
if( disposing )
{
_browser.Dispose();
_browser.ContainingControl = null;
if(null != _browser && null != components)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

No comments: