1. Metadata.
Com, all information is saved in the Type Library and cannot be extended. In. net, metadata is used to describe and can be extended using custom attributes.
2. Memory release
In COM, The iunknown interface is the interface that every COM object must implement. It provides three methods, two of which are related to the number of references. If you need another interface pointer, the customer ProgramThe addref () method must be called. This method will increase progressively, and the Rlease () method will decrease progressively. If the number of references is 0, the object will be destroyed.
3. interfaces (custom interfaces, dispatch interfaces, and dual interfaces)
The interface is the core of COM, which distinguishes between the customer object and the object contract and implementation method.
A. Custom Interface
Derived from the iunknown interface, the virtual table method sequence is defined, so the client program can directly access the interface method.
B. Dispatch Interface
In the dispatch interface, the client program always uses the idispatch interface. idispatch is derived from the iunknown interface. In addition to the two methods in the iunknown interface, there are four methods. The important one is that getidsofnames () searches for the name-ID table. The dispatch ID is returned, and the client program uses this ID to call the method invoke ().