HACKER Q&A
📣 Foe

Do people still use COM C++ in 2020?


Outside of legacy code, is there a reason to use COM (Component Object Model) C++ in 2020 if you're programming on Windows? Is there an alternative from Microsoft? My impression was that COM died off after Microsoft went all in on .NET, but now C++ seems to be having a resurgence within Microsoft. But whenever I look up a COM guide, it's from at least a decade ago. Does Microsoft recommend we use COM, Modern C++, or a mix of the two when developing on Windows, and do they have a guide somewhere?


  👤 ak39 Accepted Answer ✓
COM is still the only binary object-to-object cross language interface on Windows. Late-binding COM is still a good thing.

What is somewhat dead is the idea of building server-side enterprise middle-tier in COM (COM+). That died when the dastardly Pet Store Wars ended and distributed transactions lost their hype.

What are you building?


👤 mister_hn
A lot of Windows Internals are still relying on COM, especially those relative to Drivers, Authentication and Networking.

Take also for example GUIs made with ATL/MFC: these are using COM classes, especially in IPC.


👤 phendrenad2
I'm pretty sure calling DirectX (even 12) in C++ can only be done via COM, so I assume modern game engines still use it.

👤 kazinator
You just have to look at your Windows Registry to see the reams of COM objects that are registered.