The delegate class hasn't got a method or property "InvokeRequired".
If I want to access the UI from a background thread in a windows forms application, I call 'BeginInvoke' on my form to switch to the UI thread. My question is: Do I need to do something similar in an Excel addin to access Excel from a background thread. I haven't found anything implementing 'ISynchronizeInvoke' in the interop assemblies. And I haven't got a form... -----Ursprüngliche Nachricht----- Von: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Im Auftrag von Vince P Gesendet: Mittwoch, 1. Februar 2006 08:30 An: [email protected] Betreff: Re: [ADVANCED-DOTNET] AW: [ADVANCED-DOTNET] Excel AddIn and Threads The delegate referencing the method you want to run asynch. -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Andreas Heisel Sent: Wednesday, February 01, 2006 1:29 AM To: [email protected] Subject: [ADVANCED-DOTNET] AW: [ADVANCED-DOTNET] Excel AddIn and Threads On what object do you call 'Invoke.Required'? -----Ursprüngliche Nachricht----- Von: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Im Auftrag von Alex Smotritsky Gesendet: Mittwoch, 1. Februar 2006 08:11 An: [email protected] Betreff: Re: [ADVANCED-DOTNET] Excel AddIn and Threads 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 =================================== 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 =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
