I have created an application that loads assemblies (plugins). These plugins
are windows forms that have an embedded browser.
private AxSHDocVw.AxWeb Browser browser;
If I comment out
this.browser = new AxSHDocVw.AxWeb Browser();
and associated code to avoid exceptions like
this.browser.Do ck = System.Windows. Forms.DockStyle .Fill;
this.browser.En abled = 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**********@Be llSouth.net
=============== =============== =============== =============== =
EXCEPTION:
An unhandled exception of type 'System.NullRef erenceException '
occurred in system.windows. forms.dll
Additional information: Object reference not set to an instance of an object.
=============== =============== =============== =============== =============== ===
CODE
main()
{
try {
plugin = (IPlugIn)assemb ly.CreateInstan ce("AJB.Plugin" );
plugin.PluginID = 74;
thr = new Thread( new ThreadStart(plu gin.Execute) );
thr.ApartmentSt ate = ApartmentState. STA;
thr.IsBackgroun d = true;
thr.Start();
thr.Join();
}
catch (Exception e)
{
string s = Application.Exe cutablePath.ToS tring() + "\n" + e.ToString() + e.Message + e.StackTrace;
MessageBox.Show (s, "ExecutePlugin( ) Error");
}
}
public void Execute()
{
InputForm ajbInputForm = new InputForm();
ajbInputForm.Sh owDialog();
ajbInputForm.Cl ose();
}