If in the background thread you're not accessing any shared resources you
may not need to do any synchronization. You can use BeginInvoke with a
delegate to call a function and put it on a background thread to do
background processing. Some people will use a callback to set off a function
that say accesses excel, I usually don't do that. I'll call that function at
the end of the method that does the background task. In that called function
I'll use if (Invoke.Required) to switch back to the ui thread if necessary
or not if the function doesn't touch the ui and then that function can do
whatever it needs to do.

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Andreas Heisel
Sent: Wednesday, February 01, 2006 1:37 AM
To: [email protected]
Subject: [ADVANCED-DOTNET] Excel AddIn and Threads

Hello,

I'm developing an Excel addin. I want to do some work on a background
thread. At the end of the background processing I need to access Excel to
insert some data into a worksheet.

Do I need to do any synchronisation as in a windows forms application? If I
need to, how should I do it? I haven't found an ISynchronizeInvoke
implementation.

Or does the runtime do the synchronisation? The Excel classes are COM
interop.


Andreas

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to