The .NET Thread class has a handy function GetApartmentState() that returns the apartment of context of the thread. Is there a similar Co<something-something> function for native code (C++, C)? I feel like I should know, since I've been programming COM for almost 10 years, but I cannot find the answer.
Asked
Active
Viewed 1,630 times
1 Answers
10
The function you're looking for is CoGetApartmentType
.

Raymond Chen
- 44,448
- 11
- 96
- 135
-
Thank you! I guess my eyesight is not very good, as I just been scanning the list you linked to. – Max Apr 12 '13 at 21:45
-
1Note that this is a new API available in Windows 7 and Windows Server 2008 R2. Please read the article thoroughly for full details. – Euro Micelli Apr 13 '13 at 03:17
-
2@EuroMicelli The article also explains what to do on older systems. – Raymond Chen Apr 13 '13 at 04:07