The friends who begin to learn COM usually have been classified, and the relationship between the interface and the dynamic link library has a fog! The implementation of the COM uses the DLL as a carrier. The COM communicates through the interface, and the interface must be delegated; if some friends have thought of encapsulating the class into the dynamic link library, but only export functions in the DLL can be external program Visit, so, some friends don't know what to do. In fact, just understand the subtle relationship between these three, will be half-meter in the process of learning COM, and you can also understand the powerful role of the three mutual cooperation.
The class and the interface are the concept of abstract, and the product-oriented product, and the dynamic link library is a binary execution file, which is mapped by the client to your own virtual address space!
The class packaged data and method, and the interface can be considered a call agreement.
The interface can only define methods, but cannot be implemented, the interface must be implemented by a class, and the class truly defines the data, and the method is implemented.
In the Object Pascal syntax of Delphi, the class cannot be inherited, and can only be born by root TOBJECT and their subclasses; and all interfaces must inherit the IUnknown interface (this is not related to the Pascal syntax), and supports multiple inheritance.