By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,385 Members | 1,135 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,385 IT Pros & Developers. It's quick & easy.

Help: Exception using Threads and AxSHDocVw.AxWebBrowser

P: n/a
I have created an application that loads assemblies (plugins). These plugins
are windows forms that have an embedded browser.

private AxSHDocVw.AxWebBrowser browser;

If I comment out
this.browser = new AxSHDocVw.AxWebBrowser();
and associated code to avoid exceptions like
this.browser.Dock = System.Windows.Forms.DockStyle.Fill;
this.browser.Enabled = true;
from my plugin, then I don't get the exception.

I only receive the exception when using Threads. If I don't use threads then I don't
get the exceptions. The exception is generated --=> AFTER <=-- exiting main(). It
is NOT caught by the catch().

Any thoughts?

================================================== ===========

An unhandled exception of type 'System.NullReferenceException'
occurred in

Additional information: Object reference not set to an instance of an object.

================================================== ============================


try {
plugin = (IPlugIn)assembly.CreateInstance("AJB.Plugin");
plugin.PluginID = 74;

thr = new Thread( new ThreadStart(plugin.Execute) );
thr.ApartmentState = ApartmentState.STA;
thr.IsBackground = true;
catch (Exception e)
string s = Application.ExecutablePath.ToString() + "\n" + e.ToString() + e.Message + e.StackTrace;
MessageBox.Show(s, "ExecutePlugin() Error");
public void Execute()
InputForm ajbInputForm = new InputForm();
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.