Delphi COM Programming Technology Five (ActiveX technology) __ Programming

Source: Internet
Author: User
Tags ole
first, the active technology introduction:

1. Interfaces involved in active documentation

1>, IOleDocument interface: This interface is an interface in an ActiveX document server that enables a Document object to communicate with its containment and use its data to create a view that enables a Document object to enumerate its views and provide relevant information to the package container. such as whether or not to support multiple vision.

2>, IOleDocumentView interface: Enables a package container program to communicate with each view through the support of the Document object.

3>, IOleCommandTarget interface: You can make the server object and its package container program distribute commands.
4>, IPrint interface: You can enable any compound document and specific active document to support printing.

5>, IOleDocumentSite interface: This interface is an interface in an ActiveX document containment that enables a document that has already been implemented as a document object to bypass the usual activation order when the object is activated in the field, and directly instruct its client site to activate as a Document object.

6>, document site: A customer site with special features that directly directs its client site to be activated as a document object. The package container program needs to provide a related document site for each document object that implements a separate document view site object for each view of the active document.

2, Active control

In contrast, an ActiveX control can be said to be one of the most widely used COM components in all COM applications. This COM component integrates the various applications of COM, such as OLE documents, automation, type libraries, and so on. ActiveX controls typically exist as DLLs or OCX, and can only be used in package container programs and not run independently, unlike ActiveX documents.
An ActiveX control is a COM component that implements a series of specific interfaces so that it is more like a control in use and appearance. ActiveX controls this technology involves almost all of the technical essentials of COM and OLE, such as linked objects, unified data transfer, OLE documents, property pages, persistent storage, and OLE Automation.

3. The connection and difference between ActiveX control and Automation service:
ActiveX controls, as basic interface units, must have their own properties and methods that are suitable for different characteristics of the program and provide functional services to the package container program, whose properties and methods are supported by the IDispatch interface of the automation service.

Distinction One: events;

In addition to properties and methods, ActiveX controls have an attribute--an event--that distinguishes it from automation services. An event refers to a notification that is sent from a control to its containment program. Like a window control that notifies its owner by sending a message, an ActiveX control notifies its package container by triggering an event. The triggering of an event is usually achieved by invoking the method of the automation object through the IDispatch interface provided by the control package container. When you design an ActiveX control, you should consider what events the control might occur and what events the package container program will be interested in and include in the event.
Difference two: The source of the methods, properties, and events:

Another difference between ActiveX controls and automation Services is that there are two different types of methods, properties, and events that are custom and inventory (stock). Custom methods and properties are common automation methods and properties, and custom events are events that choose their own names and dispatch IDs. The so-called inventory methods, properties, and events are the "standard" methods, properties, and events that use ActiveX controls to specify the name and dispatch IDs.
Second, the application of active technology:

1, Delphi Writing ActiveX control (OCX Control) knowledge and examples

2, Delphi writing ActiveForm form Engineering knowledge and sample (Development browser client application)

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.