Article ID: 309330 - View products that this article applies to.
This article was previously published under Q309330
When you call a Component Object Model (COM) component that has been marked as single-threaded apartment (STA), you may receive an instance of InvalidCastException or experience errors in marshaling parameters and return values.
By default, a managed thread is initialized as multithreaded apartment (MTA). If a COM component is marked as STA, a proxy (or stub DLL) or automation-compatible Type Library file must be registered to properly communicate with it from an MTA thread.
To resolve this issue, use either of the following methods:
Managed and Unmanaged Threading
Article ID: 309330 - Last Review: April 8, 2009 - Revision: 4.0