0
Answer

Problem with C# multithreading and COM interop

Administrator

Administrator

21y
1.7k
1
I have a third party COM object and 'am accessing it through .NET C#. This is not a problem until I attempt to access the COM object from multiple threads. What is happening is that the COM object (MTA) seems to only have one instance. I know this because the COM object error logging identifies it's thread id which is always the same no matter how many threads I instantiate the COM object from. The thread attributes are set to MTA before I call 'new' on the COM object, and I'm creating a new object in each thread. Further, I have managed to get the system working properly in Vicual C++ with multiple threads using exactly the same COM dll. Help! Regards, James