The IUnknown Interface

Globally Unique Identifiers

COM uses globally unique identifiers (GUIDs), 128-bit integers guaranteed to be unique, in order to identify every interface and every COM component class. Human-readable names are assigned only for convenience and are valid only on the computer in which the component is located. This helps ensure that COM components do not accidentally connect to the "wrong" component, interface, or method, even in networks with millions of COM components .

click to view at full size.

Figure 5.4 Identifying components

CLSID and IID

Each COM component you create must have a GUID called the Class Identifier (CLSID) that refers to the component. A GUID must also be created for each interface in your component; this GUID is called the Interface Identifier (IID).

The class ID string is stored in this registry key:

 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID 


Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net