COM Object Class Library Threading model
Hi
I have written an object in C# and exposed it as a COM object. This object
is used in a native application and that application creates one or more
threads that creates and uses its own copy of my C# COM object.
My C# COM object has reduced my performance of my native application because
all objects are create in a single threaded apartment. A call to
Thread.GetApartmentState() inside my C# COM object returns ApartmentState.STA.
Since the my C# COM object is in a class library I do not have a "Main"
method and can not apply the MTAThreadAttribute.
So my question is how do I tell my COM Class Factory to build objects that
are in a Multi threaded apartment in .NET C#?
If it's just not possible I would also like to know that as well.
Cheers,
Davinci
Date:Thu, 23 Aug 2007 08:04:04 -0700
Author:
|