.NET Library > System.Runtime.InteropServices
Replaces the standard common language runtime MTA marshaler with the standard OLE STA marshaler
StandardOleMarshalObject only keeps things on the main thread if you create the object on a STA thread.
This class prevents calls made into a hosting object by OLE from entering threads other than the UI thread.
Any public static members of this type are thread safe
Any instance members are not guaranteed to be thread safe
If you expose your add-in through the COMAddIn.Object method either explicitly (non VSTO) or implicitly (with VSTO through RequestComAddInAutomationService) you might run into threading issues
1) Being called from VBA - OK
2) Being called from another add-in in the same process
3) Being called from another process or thread there is a problem. By default these will not be executed on the main UI thread.
From a COM perspective all managed objects are thread neutral (by default)
What we want is to tell COM that our managed object lives in a Single Threaded Apartment (STA).
Needed for COMVisible interfaces passing List<string>
Necessary when working with generics
© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext