What kind of apartment is the private apartment I created via CLSID_Context­Switcher?

Raymond

Some time ago, I talked about how you can create COM apartments inside COM apartments. I forgot to mention what kind of apartment you get.

From what I can tell, the resulting private context has the same apartment model as the apartment that created it. If you are executing on a thread in a single-threaded apartment, and you create a CLSID_Context­Switcher, then the resulting context is also a single-threaded apartment. Conversely, if you are executing on a thread in a multi-threaded apartment, then the resulting context is also multi-threaded.

 

0 comments

Comments are closed. Login to edit/delete your existing comments