ActiveX basics-What is ActiveX

Source: Internet
Author: User

An Internet Policy

ActiveX is based on an Internet policy. It includes Ole, COM, and Internet development.

ActiveX development involves a wide range of ActiveX development, including many aspects, such as automated servers, ActiveX controls, and COM objects.

Term ActiveX has become a battle slogan for many developers and teams in the past few years. On the other hand, the market has also publicized it. However, few people can clearly explain its exact meaning. This book aims to explain what ActiveX is and what it means to developers. I hope that readers can learn as much as they can to write a book.

An Internet strategy for application development

Microsoft introduced ActiveX for the first time at the intenet Professional Development Conference (Internet PDC) in 1996. ActiveX originated from the Conference's slogan "Activate the Internet" (which can be understood as making the Internet active). ActiveX is not so much a technology or architecture for developing applications, it is a kind of inspiration.

During the development conference, Microsoft was fiercely competing with Netscape, which controlled the Internet browser market. However, the Conference demonstrated that Microsoft is not only interested in the browser market. Microsoft demo tools include front-end electronic storage products, new Ole controls, and virtual reality chat software.

ActiveX is a new slogan shared by Micrsoft. It is similar to the OLE (Object Linking and Embedding, object link and embedding) proposed in early 1990s. In a short time, far beyond "Activate the Internet ".

ActiveX becomes a term that contains everything: from web pages to Ole controls. ActiveX started to become important: on the one hand, small, fast, reusable components allow you to closely grasp the latest technologies from Micrsoft, internete, and industry; on the other hand, activeX represents the policy for integrating the Internet with applications. Currently, the absence of Internet and ActiveX technologies in products or companies is considered outdated. In fact, describing ActiveX is like describing colors. It is neither a technology nor an architecture, but a concept and a guide.

ActiveX, Ole, and Internet

ActiveX and Ole began to become synonyms. once mentioned, Ole controls have now become ActiveX controls, and Ole document objects have now become ActiveX document objects. Sometimes, the entire document on how to implement OLE technology is updated to ActiveX technology. The only change is the term Ole, which is now named ActiveX.

Although Ole and ActiveX have made great progress and there are new technologies related to it every day, whether or not the Internet has been or is directly involved in many related fields is questionable. The demand for small, fast, and reusable components (COM components) has been around for some years. Distributed Components (DCOM components) the first demonstration was made at the OLE 2.0 professional development conference a few years ago. Visual Basic (VB) Development Team plays a role in making ActiveX technology possible in the early stages. The basectl framework included in ActiveX SDK is developed by the VB development team. It solves the needs of VB for small and lightweight components to reduce loading time. The only contribution of Internet is that it requires a way to implement and publish web pages. In fact, every new ActiveX function can be traced back to the most basic global universal demand for small, fast, and reusable components, which started with OLE and COM.

ActiveX does not mean to replace Ole. It simply expands it to include Internet, enterprise intranet business applications, home applications, and tools for developing these applications.

Microsoft has published a large number of documents on ActiveX development. The OC 96 Specification defines how to develop and start controls that are faster and more capable of drawing. It also defines which interfaces are required and which interfaces are optional ." OLE Control and control container Guidelines provides important information about the interaction between controls and control containers. Microsoft's Web site becomes the center for creating, using, and distributing ActiveX components with rich information.

In addition to the technical details of creating ActiveX components, Microsoft has established a set of standards for using and integrating ActiveX components. Every product from VB, Micrsoft word to Java inherits the ability to use ActiveX components. Before the emergence of ActiveX technology, more than half of applications could not be seamlessly integrated as they are today.

The following section describes the types of ActiveX components that we can create, and when and why we need them-this may be more helpful.

ActiveX Component Classification

The topic of this book is the development of ActiveX components. These components can be divided into the following types:

Automation Servers: Automated servers
Automation controllers: automation controller
Controls: Controls
COM objects: COM Object
Documents
Containers: Container

This book only details the automation servers, controls, and COM objects. Automation controllers, documents, and containers involve too many interfaces and too many technologies, beyond the scope of this book.

Automated Server

An Automation server is a component that can be programmed and driven by other applications. An automated server contains one or more idispatch-based interfaces to allow other applications to create and connect to it. Based on the characteristics of the server itself, an automated server may or may not contain a user interface.

The Automation server can be in-process (running in the Controller's process space), local (running in its own independent process space), and remote (running in the process space of other machines ). In some cases, the specific server implementation will specify where the server runs, but this is not guaranteed. Dll can run locally or remotely within a process, while EXE can only run locally or remotely.

Note: For controllers, the fastest execution is the in-Process Automation server. But remember that using an in-process server does not guarantee its performance. If an Automation server is created in a process space and controlled by a controller in another process, it is downgraded to an out-of-process server, its performance is the same as that of an out-of-process server. For more information about conflicts between process spaces and servers, see the second part of this book.

Automatic Controller

Automated controllers are applications that can use and operate automated servers. A good example is VB. Using VB, you can create, use, and destroy automation servers, just as if they are a complete Part Of The VB language.

The automation controller can be an application of any type, DLL or EXE, and can access the Automation server locally and remotely in the process. Generally, the implementation of the registry entry and server specifies the process space in which the Controller-related Automation server should run.

Widget

ActiveX is equivalent to ole control or OCX. A typical ActiveX control consists of a user interface that exists during design and runtime, and an idispatch interface that defines all the methods and attributes of the control, an iconnectionpoint interface that defines events that can be triggered by controls. In addition, it may support persistence during the running life cycle and various user interface functions, such as cut-and-paste and drag-and-drop operations. In terms of structure, a control must support a large number of COM interfaces to take advantage of these functions.

With the release of the new ole control and ActiveX Development Guide, a control is not limited to the above functions. However, developers can only implement those functions, because they are the most useful and are most interested in users who use applications. The control and container guide published by Microsoft lists all interfaces and their special requirements. You can find this information on Microsoft's website http://www.microsoft.com.

ActiveX controls are always running in processes for containers. The extension of a control is usually ocx, but in the execution mode, it is just a DLL.

COM Object

The COM object is structured like an Automation server and a controller. They contain one or more com interfaces with some or no user interfaces. However, these objects cannot be used by controllers in the form of automated objects. The controller must understand the COM interface to communicate with these interfaces, which are irrelevant to the automation interface. The Windows 95 and NT operating systems define hundreds of COM interfaces and custom interfaces as operating system extensions, and control everything from desktop appearance to 3D screen rendering. COM object is a good way to organize related functions and data, and still retains the high performance requirements of DLL.

Note: Automated servers can also benefit from the COM interface, which is a dual-interface server. The Automation server interface has an accompanying COM interface that describes the methods and Properties of objects. Automatic controllers like VB can use the advantage of dual interfaces to provide higher performance when using servers. A disadvantage of a dual-interface server is that when defining properties and methods, its data type is limited to the type supported by OLE automation.

Document

ActiveX documents, or originally known as document objects, indicate objects that are not just a control or server. A document can be any, a spreadsheet, or a complex invoice in a financial application. Document, like a control, with a user interface and a container application as the host. Microsoft Word and Microsoft Excel are complex document servers, Microsoft Office binder and Microsoft Internet Explorer are ActiveX document containers.

ActiveX document architecture is an extension of the OLE link and embedded model. It allows the document to get more control through its host container. The most obvious change is how the menu is displayed. The menu of the standard Ole document will be merged with the menu of the container to provide the combination function set, while the ActiveX document will occupy the entire menu system, therefore, it only indicates the functions of documents, rather than the functions of both documents and containers. In fact, the function set exposed by the document is the premise of the difference between the ActiveX document and the OLE document. Containers are only a host mechanism, while documents have all the control.

Other differences are printing and storage. Ole documentation intentionally becomes part of its host container documentation, so it is printed and stored as part of the container documentation. ActiveX documents expect to support their own printing and storage functions, and are not integrated with the host documents.

ActiveX documents use a unified representation structure, rather than the embedded document architecture of OLE documents. Microsoft Internet Explorer is a good example. It only displays Web pages for users, but views, prints, and stores pages as an entity. Microsoft Word and Microsoft Excel are Ole document architectures. If Excel workbooks are embedded into Word documents, the workbooks are stored together with the Word documents and become part of the complete Word documents.

ActiveX documents also provide some additional functions to support web page publishing through the Internet or internat. Imagine that an internal order tracking system runs in the same web browser as the one used to connect to the Internet.

Container

ActiveX containers are applications that can host ActiveX servers, controls, or documents. Both VB and ActiveX control pad can be used as ActiveX servers and control containers. Microsoft Office binder and Microsoft Internet Explorer are containers that can act as ActiveX servers, controls, and document hosts.

As ActiveX controls and document specifications have fewer requirements, containers must be sound enough to handle the absence of certain interfaces in controls or documents. Container applications may have little or no interaction with controls or documents, or provide important interaction capabilities when presenting and operating components. This capability relies entirely on the component's host container, which is not necessary in any container development.

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.