473,394 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Help: Exception using Threads and AxSHDocVw.AxWebBrowser

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();
}
Nov 15 '05 #1
0 1644

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Elliott | last post by:
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...
3
by: Simon CJC | last post by:
Hello I use AxSHDocVw.AxWebBrowser in a windows application. But sometimes the url I browsed in AxSHDocVw.AxWebBrowser contains error caused by javascript. Can I prevent javascript from running in...
1
by: Pengyu | last post by:
I host AxSHDocVw.AxWebBrowser in my C# application. It generally works ok. However, the AxSHDocVw.AxWebBrowser control sometime stucks and can not nevigate to other URLs. What is the problem? BTW,...
0
by: Manuel Costa | last post by:
Hi i want to restrict the AxSHDocVw.AxWebBrowser to html pages. For example, when clicked, links to files by http or ftp should be canceled. manuel
2
by: Chance Hopkins | last post by:
I'm trying to use the AxSHDocVw.AxWebBrowser control in a form and when I call .Navigate, instead of showing the html page, the download prompt shows up. If I click open, it uses my default browser...
0
by: Eþref DURNA | last post by:
I m navigateing a url and want to display that image at my web browser on my Windows application I m using AxSHDocVw.AxWebBrowser but when ever i redirect that url it does not shows that image it...
1
by: jokolee | last post by:
i was using component AxSHDocVw.AxWebBrowser,,but i rather confuces because when i write AxWebBrowser1.Document. the next option is Gettype function,,,nothing else...... But when i write...
0
by: nick_nw | last post by:
Hi, I've recently started moving my project's code into a parent project. Since doing so the AxSHDocVw.AxWebBrowser control and my form stops showing the file that I nvaigate to (via Navigate...
3
by: GS | last post by:
the documentcomplete and NavigateComplete2 in AxSHDocVw.AxWebBrowser all seem to fire per frame. Is there a way to catch when the page is totally completed including frames.? in some other...
1
by: tim2006 | last post by:
When i try to run the program, it just hangs. If i remove the axwebbrowser control it works fine. Any ideas? Here is my code: class1.vb Imports System.Windows.Forms Imports...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.