When defining an interface, the logical name that follows the keyword interface is called the interface. If no GUID is introduced, this logical name is the unique identifier of the interface. As shown in chapter 1, this logical name string is used when the runtime query object (dynamic_cast) is used.
When twoProgramEach member independently develops an interface. In a given common problem domain, the two interfaces are not completely defined. The actual sequence of the method definition and the prototype of each method may be different, however, the two programmers give the interface the same logical name.
During use, the client program for the interface developed by the first programmer may run together with the object developed by the second programmer, if you use a logical name string to check whether the object supports this interface, the object will be satisfied and a non-null pointer will be returned. At this time, the returned interface is developed by the second programmer, it is not the first interface developed by a programmer to actually ask.
In order to eliminate name conflicts, com introduces guid as the actual name of the interface to uniquely identify the interface.
The GUID referenced in COM is based on the uuid (universally unique identifier) used in Dec RPC.
When GUID is used to name a COM interface, it is called Interface ID (IID ).
When GUID is used to indicate the implementation of the COM interface, it becomes the class ID (CLSID ).