× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Tim,

I can see a couple of problems. Take a look at the comments in my sample
code.

First, COM objects must be run in a STA (Single Threaded Apartment)
thread, by default threads are MTA (Multi-Threaded Apartment). You need
to set the AparementState on any thread that will use COM. Running COM
in MTA threads is, um, unpredictable. :-)

Second, you cannot access a UI element from a thread other than the one
that created it, and remember the form itself is a UI thread. I would
.Invoke() the data back into the UI thread and then set lbl1 and brweb
from there. Why did you create the browser on its own thread? Just
create the browser on the base UI thread.

And please look into log4net or some other logging infrastructure and
use it in your code. Debugging a multi-threaded app is very difficult
since the act of debugging must suspend threads and that changes the
dynamic of the runtime. Also, if you can, test your app on true
multi-core/multi-proc machines.

-Walden


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.