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?
Dave
Da**********@BellSouth.net
================================================== ===========
EXCEPTION:
An unhandled exception of type 'System.NullReferenceException'
occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.
================================================== ============================
CODE
main()
{
try {
plugin = (IPlugIn)assembly.CreateInstance("AJB.Plugin");
plugin.PluginID = 74;
thr = new Thread( new ThreadStart(plugin.Execute) );
thr.ApartmentState = ApartmentState.STA;
thr.IsBackground = true;
thr.Start();
thr.Join();
}
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();
ajbInputForm.ShowDialog();
ajbInputForm.Close();
}