The World Wide Web is now more than just an experience of browsing through static pages. ActiveX technology has brought interactive objects such as animation, audio, video and virtual reality together on the Web. Web sites can now include user control and choice, which means they can behave like traditional software applications and are delivered on demand. The Web will have a more direct impact on people's lives and work, and will transform the way people use the Internet due to these exciting changes in technology.
What is COM?
COM (Component Object Model) is a framework for creating and using components. It provides the widest choice in services, tools, languages and applications. It also makes software easier to write and reuse. Some features of COM are that you can use any programming language and there is flexible security. Also, it is integrated with Development Tools, there are mature specification and reference implementation, and its services used in a standard way, regardless of location.
The Evolution of ActiveX
When Microsoft released OLE 2.0 in 1993, it was the first technology to be based or built upon COM. Under OLE, the operating system provided a common support structure for all applications that use the OLE controls and functionality. This gives a more standardized object model for both application developers and users. OLE Controls allow the creation of functions within a document that act as if they were programs running inside the document itself. Since then, components such as automation, controls and compound documents are now called ActiveX. ActiveX includes both client and server technologies.
What is ActiveX?
ActiveX is a set of technologies from Microsoft that enables interactive content for the World Wide Web, which is based on COM. It is not a programming language, but a set of rules for how applications should share information. ActiveX makes it easy to integrate and reuse any components such as HTML documents, Java Applets, Java Script and more. For Intranet developers, ActiveX provides core functionality for building reliable enterprise-wide applications offering enhanced productivity beyond basic HTML document sharing.
ActiveX has a powerful combination of innovation and productivity of interactive programming, along with ubiquity and standardization of the Internet. Before ActiveX, Web content was static, 2-dimensional text and graphics. With ActiveX, Web sites come alive using multimedia effects, interactive objects, and sophisticated applications. It allows Web producers to use the most imaginative work from the software development community and make it available to the widest possible audience. ActiveX creates engaging and appealing web experiences for users. It is also a means of immediate availability of thousands of useful building blocks that can be incorporated into Web pages for web designers. It enables developers with varied backgrounds and expertise to bring creativity to the Web because it is supported by many different languages and tools. ActiveX is important because it allows developers and Web producers to create unique and interactive Web sites quickly and easily. This in turn will make the Internet more useful and productive.
Elements of ActiveX
The three main elements of ActiveX are ActiveX Controls, ActiveX Scripting and ActiveX Documents.
ActiveX Controls
ActiveX Controls are interactive objects in a Web page that provide user-controllable functions and are manipulated visually by GUI development tools. They provide tools for linking desktop applications to the World Wide Web and are also programmable by other components and scripts.
ActiveX Controls can reside locally on a client machine or they can be downloaded from the Internet. They can also be used to handle client-side interactions with the user. ActiveX Controls may be as simple as a button or as complex as a reporting tool. They are the third version of OLE controls (OCX), providing a number of enhancements specifically designed to facilitate distribution of components over high-latency networks and to provide integration of controls into Web browsers. These enhancements include features such as incremental rendering and code signing, to allow users to identify the authors of controls before allowing them to execute.
ActiveX controls communicate through the low-level DCOM mechanism that allows controls to access each other's exposed methods, regardless of whether the controls reside in the same container, in the same machine, or on different machines. These controls are linked through events; the development environment allows developers to create methods that are called when events are initiated by any components being used.
ActiveX Scripting
ActiveX Scripting is used as a medium to initialize and manipulate the various elements on an HTML page, including forms, Java applets, and ActiveX controls from the browser or server. The currently available ActiveX Scripting languages are VBScript and JavaScript (default script). These scripting languages use OLE Automation to communicate with an ActiveX Control; the ActiveX Control fires OLE events that can be handled in the ActiveX Script code in response to user interactions (such as clicking on a button in the ActiveX control).
ActiveX Documents
An ActiveX document is a structured storage file that is displayed by an ActiveX component, that enable users to view non-HTML documents, such as Microsoft Excel or Word files, through a Web browser. But you do need these programs installed on the machine. Also, existing documents can be published on the Internet site without having to resave them in HTML format. Users are provided with a consistent interface since they are allowed to navigate, view and edit the contents of documents that can not be render using HTML alone. Some features of ActiveX Documents are that they use the entire client area, they provide printing support and have menu merging and toolbars, as well as they integrate existing documents into the browser or any other application.
ActiveX vs. Java
ActiveX has some advantages over Java. ActiveX controls are similar to Java applets. However, ActiveX controls have full access to the Windows operating system, which gives them much more power than Java applets. Also, the controls you download are saved to your hard drive every time you visit a different web page. Java, on the other hand, requires you to download a Java applet each time you visit a page because applets are not cached. Also, Java applets are limited in function since they cannot interact with a user's machine outside of a specified "sandbox", which is a barrier between the applet and the rest of the user's computer. Applets cannot write to your hard drive or start-up an application residing on your machine. Yet, this disadvantage means that critical areas such as the file system or the boot sector are strictly off-limits since Java applications are in a protected memory area. Theoretically, this makes it impossible for applets built in Java to damage a computer or its contents. It also walls applets off from working with other applications or piggybacking on system services, and it forces users to download an applet every time they want to use it. Java also provides cross platform support and is more secure.
How to Use ActiveX Controls in Web Pages
Embedding ActiveX controls
The process of embedding ActiveX controls into a web page is very similar to the way Java applets are embedded. The following example shows the HTML code used to embed an ActiveX control.