Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Problem with C# multithreading and COM interop

Mar 26 2003 7:50 AM
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