COM and. net

Source: Internet
Author: User
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 ().

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.