The thread associated with the STA of COM object in C#
In C++, when I call CoInitialize() an STA is being created an associated
to thread t that is calling "CoInitialize()". Now, if I understand
correctly, when t creates a COM object, the object is associated with the
STA that is associated with t, which means that only "t" can make calls to
this object.
My question is what happens in C#? Who call CoInitialize()?
Some background: my question raised from a thread impersonation problem. A
thread is impersonated to a user and then it calls COM object, does the
thread that calls the COM object is really the thread that is executing
the code inside (inside the COM objects there are no new threads).
Thanks a lot!
No comments:
Post a Comment