Support for multiple programming contexts is handled by relying on the object for aspects that would be challenging to implement as a facility.
COM is available only in Microsoft Windows and Apple's Core Foundation 1.3 and later plug-in application programming interface (API).
Antony Williams, involved in architecting COM, distributed two papers within Microsoft that embraced the concept of software components: Object Architecture: Dealing With the Unknown – or – Type Safety in a Dynamically Extensible Class Library in 1988 and On Inheritance: What It Means and How To Use It in 1990.
Object Linking and Embedding (OLE), Microsoft's first object-based framework, was built on DDE and designed specifically for compound documents.
COM was created to replace DDE since its text-based conversation and Windows messaging design was not flexible enough to allow sharing application features in a robust and extensible way.
Microsoft's implementation of DCE/RPC, MSRPC, is used as the primary inter-process communication mechanism for Windows NT services and internal components, making it an obvious choice of foundation.
Microsoft introduced Microsoft Transaction Server (MTS) in Windows NT 4 in order to provide developers with support for distributed transactions, resource pooling, disconnected applications, event publication and subscription, better memory and processor (thread) management, as well as to position Windows as an alternative to other enterprise-level operating systems.
Renamed to COM+ in Windows 2000, the feature set was incorporated into the operating system as opposed to the series of external tools provided by MTS.
Instances of a component, if coded properly, could be pooled and reused by new calls to its initializing routine without unloading it from memory.
Similarly, queued components can be replaced by Windows Communication Foundation (WCF) with an MSMQ transport.
For instance, it allows objects to be transparently marshalled by value across process or machine boundaries more easily.
Because of its COM-like basis, WinRT supports interfacing from multiple programming contexts, but it is an unmanaged, native API.
Nano-COM is a subset of COM focused on the application binary interface (ABI) aspects of COM that enable function and method calls across independently compiled modules/components.
Rather, object references are simply passed across function boundaries and allocated via standard language constructs (e.g., C++ new operator).
The basis of Nano-COM was used by Mozilla to bootstrap Firefox (called XPCOM), and is currently in use as the base ABI technology for DirectX/Direct3D/DirectML.
Using ActiveX components, as Internet Explorer supported, in a web page lead to problems with malware infections.
Microsoft recognized the problem as far back as 1996 when Charles Fitzgerald said, "We never made the claim up front that ActiveX is intrinsically secure".
The transparent support for out-of-process COM servers promotes software safety in terms of process isolation.
COM is supported via bindings in several languages, such as C, C++, Visual Basic, Delphi, Python[10][11] and several of the Windows scripting contexts.
IDL also supports bracketed attributes before declarations to define metadata such as identifiers and relationships between parameters.
MIDL can generate a binary type library (TLB) that can be used by other tools to support access from other context.
It also shields COM client application developers from the need to directly maintain reference counting, by providing smart pointer types.
Other libraries and languages that are COM-aware include the Microsoft Foundation Classes, the VC Compiler COM Support,[12] VBScript, Visual Basic, ECMAScript (JavaScript) and Borland Delphi.
The Microsoft Visual C++ compiler supports extensions to the C++ language, referred to as C++ Attributes, [13] that are designed to simplify COM development and minimize boilerplate code required to implement COM servers in C++.
[16] This technology has limited support for EXE COM servers[17] and cannot be used for system-wide components such as MDAC, MSXML, DirectX or Internet Explorer.
Out-of-process and remote objects use marshalling to serialize method calls and return values over process or network boundaries.
Method calls from threads outside of the apartment are marshalled and automatically queued by the system (via Windows messaging).
Thus, the COM run-time provides synchronization to ensure that each method call to the object is executed to completion before another is invoked.
Free The COM run-time provides no synchronization, and multiple threads are allowed to call object methods simultaneously.
Both The server auto-selects STA or MTA at object creation to match the apartment type of the calling thread.