In C++, Global Namespace Corruption happens when we place names
in global scope and a collision occurs with the same names that
are in use elsewhere within the system being compiled and linked
as a single executable module.

In COM+, the global namespace is the aggregate of all possible
computing devices in the world. Because your COM+ component may
be remotely activated on any system in the world, it is important
that the name given to the component implementation and
interfaces are really unique across all possible execution
environments.

Globally Unique
Identifiers (GUID)
COM+ uses Globally Unique Identifiers (GUIDs) to name Interfaces
and their Implementations. The concept of a GUID was originally
conceived by the Open Software Foundation (OSF) for their
Distributed Computing Environment (DCE). The GUID is a unique
value in both space and time. It is generated on your
development machine by a standard OSF DCE algorithm. It is this
DCE algorithm that allows rapid development of COM+ objects
without requiring use of namespace partitions. COM+ provides a
tool called GUIDGEN that generates a unique GUID based on spacial
and temporal information.

GUIDs are 16-byte extremely long integers. They are defined as a struct in C/C++. The internal representation of a GUID is
shown below:

GUIDs are used to eliminate name
collisions across libraries. Each interface has a GUID called an
Interface ID (IID). Each COM+ implementation has a unique GUID
called the Class ID (CLSID). Both IID and CLSID are typedefs of
GUID and are therefore type compatible with one another.

GUIDs are generated by a tool called GUIDGEN.EXE which is
available in the Windows Platform SDK and is also bundled for
convenience with development tools like Microsoft Visual Studio.
Internally, GUIDGEN calls the COM+ API CoCreateGUID() to generate a unique GUID. You can use the COM API
to dynamically create GUIDs. It is defined as follows:

HRESULT CoCreateGuid (GUID
*pGuid);

COM also provides functions for
comparing GUIDs as follows:

BOOL IsEqualGuid (REFGUID
refGuid1, REFGUID refGuid2);

Similarly, if you ever need to
define a GUID in a C/C++ header file, use the DEFINE_GUID macro as follows: