[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Office Add-ins and threads

Tom

7/11/2007 3:15:00 PM

Hi,

Is it possible to safely run threads in a VSTO Excel 2003 Add-in?

I run my thread as a STA thread like this:

thread = new System.Threading.Thread(TestThread);
thread.IsBackground = true;
thread.Name = "Test thread";

thread.SetApartmentState(System.Threading.ApartmentState.STA);

I started to get "DisconnectedContext was detected" warnings from the
MDA right hafter I added a class library project to my add-in
solution.

Is there some magic trick to fix this or do I have to forget about
using threads and start calling Application.DoEvents every now and
then?

Br,
Tom