Chapter 2 of "com Essence Theory" (1)

Source: Internet
Author: User

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 ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.