[try Beta version]
Not logged in

 
Is there an API to determine COM apartment model?

Mar 26, 2023 at 4:34pm
Suppose you initialize COM with CoInitializeEx(NULL, COINIT_MULTITHREADED);

Is there a function which will tell if COM was intialized with COINIT_MULTITHREADED or COINIT_APARTMENTTHREADED?

Suppose you have a class which branches it's work depending on apparment model, therefore it should determine that bit first.

I know we could call the function for the second time and then based on result figure it out (followed by CoUnitilize), but surely there must be a cleaner way to do it.
Last edited on Mar 26, 2023 at 4:41pm
Mar 26, 2023 at 9:32pm
Mar 26, 2023 at 9:49pm
Nice, this is exactly what I need.
Thanks!
Last edited on Mar 26, 2023 at 9:50pm
Topic archived. No new replies allowed.