Microsoft unveiled an extensive new solution technology for the Internet called ActiveX at the Professional Developers Conference in San Francisco, March 1214, 1996. Microsoft ActiveX is a broad and powerful abstraction. Content providers and Internet application developers now have a robust and extensible framework, enabling them to develop a new generation of Internet applications.
Microsoft has been busy adding features to the Win32 Application Programming Interfaces(APIs) that will let developers "Internet-enable" their applications. These new features are based on OLE (object linking and embedding) technology so that developers who have made investments into Win32 and OLE applications can leverage their investments.
ActiveX exposes a set of APIs that enables developing a new generation of client/server applications for the Internet. ActiveX has interfaces to integrate almost every media technology within an application. It provides extensive support for animation, 3-D virtual reality, real-time audio, and real-time video.
ActiveX gives developers an open framework for building innovative applications for the Internet. ActiveX technologies form a robust framework for creating interactive content using software components, scripts, and existing applications. Specifically, ActiveX technologies enable content providers and application developers to create dynamic Web content and Web server extensions easily, by using ActiveX controls, active scripts, and the active document interfaces and ISAPI (Internet Server Application Programming Interface).
COM (Component Object Model) is the technical cornerstone for the ActiveX technology; it defines how objects expose themselves for use within other objects and how objects can communicate between processes and across a network. You can easily integrate COM objects for use in many languages, such as Java, Visual Basic, and C++. COM objects are the basic binary components for reuse.
The following concepts are fundamental to COM:
Interface: the mechanism through which an object exposes itself.
IUnknown Interface: the interface on which all others are based. It implements the reference-counting and interface-querying mechanisms required for COM objects.
Reference Counting: the technique by which an object (or strictly, an interface) keeps track of its instance count. When all references are removed from the reference count (as in the reference count is zero), the object can be deleted.
QueryInterface Method: it is called with the IID (Interface ID) of the interface to which the caller wants a pointer. IID is generated by using the DCE uuid mechanism. Unique IIDs for the standard COM, OLE, and ActiveX interfaces are predefined. The methods within QueryInterface enable navigation to other interfaces exposed by the object.
Marshaling: the mechanism that enables objects to be used across process and network boundaries, allowing for location independence. Marshaling packs the parameters of a method call into a format that can be moved between local processes or across the network to a process running on another machine. The parameters are then unpacked and executed in the context of the remote process, using the remote server's resources. Likewise, on the return from the remote call, COM must pack and unpack the outbound parameters and the return value from the call executing on the remote machine.
Aggregation: the way in which one object makes use of another. The containing (outer) object creates the contained (inner) object as part of its own creation. The result is that the interfaces of the inner object are exposed by the outer.
There are two primary pieces to the ActiveX Object Model: the Microsoft HTML (Hypertext Markup Language) Viewer component (MSHTML) object and the IExplorer Browser object. Both are in-process (DLL-based) COM classes.
All interfaces defined in the ActiveX Object Model are "Dual" interfaces. A "Dual" interface means that the objects inherit from IDispatch and follow some simple rules; therefore, they can be used by "late-bind" OLE Automation controllers (by using IDispatch::GetIdsOfNames and IDispatch::Invoke) as well as by clients that "early-bind" (for example, use a vtable).
MSHTML is the HTML viewer part of Microsoft Internet Explorer 3.0. It can be hosted in both OLE Document Object containers and OLE Control containers and can be used as a standalone OLE Automation component.
MSHTML implements the OLE Automation object model described in the HTML Scripting Object Model. With this object model, you can develop rich multimedia HTML content. Both scripts running inline in the HTML (that is, VBScript) and those running externally (VB4) can use the object model.
The IExplorer Browser object is an in-process COM Server. It also serves as a Document Object Container that can host any Document Objects, including MSHTML, with the added benefit of fully supporting hyperlinking to any document type.
The IExplorer Browser is also an OLE control, since it is a COM class object that implements all the interfaces needed to be used as an OLE control. The IShellExplorer interface is the primary OLE Automation compatible (Dual) interface exposed by the IExplorer Browser OLE control. The IInternetExplorer interface is a superset of the IShellExplorer interface; it can be contained within any OLE control container, such as the Internet Explorer 3.0.
The IExplorer Browser is the core of what customers see as "the Internet Explorer 3.0 product." Internet Explorer 3.0 supports the following HTML 3.0 extensions:
ActiveX Controls (formerly known as OLE controls) have a broader definition; they are based on COM. Straight COM objects combined with a few ActiveX interfaces can become "Internet-enabled" without needing to modify the existing object. ActiveX Controls can be created from a variety of existing object types, such as the following:
ActiveX Controls provide instant, dynamic functionality for Web pages. They are the building blocks for client- or server-driven dynamic content. Almost any type of media can be seamlessly integrated into your Web page. Sound, video, animation, or even credit-card approvals can be hosted within your Web page.
ActiveX Scripting is a syntax and language-independent architecture that allows script vendors to "plug-in" and perform automation between components. What's more, with its infrastructure, developers can use any script engine in their applications. A script is some executable block, such as a piece of text, a block of pcode, or even machine-specific execution byte codes.
ActiveX Scripting components can be grouped into two major categories: an ActiveX Scripting Engine and ActiveX Scripting hosts. A host creates a script engine so scripts can run against the host.
Here are some examples of ActiveX Scripting hosts:
The ActiveX Scripting Engine is an OLE COM object that supports the IOLEScript interfaces, with at least one of the IPersist interfaces and an optional IOleScriptParse.
ActiveX Scripting Engines can be developed for any language or runtime environment, such as
ActiveX Scripts, such as Visual Basic Script, can be used to "glue" together the functionality exposed in ActiveX Controls to create rich Web-based applications.
Active Documents are based on the OLE Document Objects (DocObjects, for short). The DocObjects technology is a set of extensions to OLE Documents, the compound document technology of OLE. It is the core technology that makes Microsoft Office Binder work. The Binder is a sophisticated "viewer" that can host a variety of heterogeneous documents so that you can create, edit, save, print, and view different kinds of information.
One obvious application for this technology is "Internet browsers"; adopting Binder technology not only facilitates presenting Internet-based information (Web pages and so forth) but also, at the same time with the same implementation, enables the browser to present documents from Microsoft Office and Microsoft Officecompatible applications. In short, you need to go to only one navigation tool to browse and view all documents, whether local or network-based.
A Document Object container must meet the following criteria:
Similarly, Document Objects must meet several criteria to be contained in DocObject containers:
The ActiveX Server Framework, another component of ActiveX technologies, is based on the Microsoft Internet Information Server (IIS) integrated in the Windows NT Advanced Server. The framework enables Web developers to take advantage of the powerful Microsoft BackOffice family of products, such as Microsoft SQL Server, Microsoft Exchange Server, Microsoft SNA Server, and Microsoft Management Server.
The ActiveX Server Framework consists of ActiveX Server Scripting and ActiveX Server controls. ActiveX Server Scripting can be written with any scripting languages, including Visual Basic Script, PERL, C, Batch, or JavaScript.
The Common Gateway Interface (CGI)is also supported under the ActiveX Server Framework. Through CGI, your server can access information in a form not readable by the client (such as an SQL database), then act as a translator between the client and server to produce information the client can use.
A server responds to a CGI execution request from a client browser by creating a new process and then passing the data received from the browser through the environment variables and stdin. Results gathered by the CGI application are expected as stdout of the newly created process.
The server creates one process for each request received. However, creating a process for every request is time-consuming and takes a lot of server resources.Using too many server resources can starve the server itself.
One way to avoid this is to convert the current CGI executable file into a DLL that the server can load the first time it gets a request for that DLL. The DLL then stays in memory, ready to service other requests until the server decides it is no longer needed.
An ISA is a runtime DLL (dynamic link library). The ISA uses the LoadLibrary and GetProcAddress functions to retrieve the starting address of a DLL function. This function pointer can then be used through the ISA to execute the function in the DLL. This type of linking eliminates the need to link with an import library.
ISAs are loaded at runtime by the HTTP server and are called through the required, common-entry points of GetExtensionVersion and HttpExtensionProc. HTTP Server calls the ISAPI DLL at the entry point of GetExtensionVersion to retrieve the version number of the specification on which the extension is based, and a short text description for server administrators. For every client request, the HttpExtensionProc entry point is called. Interaction between an HTTP server and an ISA DLL is done through extension control blocks (ECBs). The ISA DLLs must be multithread-safe since multiple requests can be received simultaneously.
An ISAPI filter is a replaceable DLL the server calls on every HTTP (Hypertext Transfer Protocol) request. When the filter is loaded, it tells the server what sort of notifications it will accept. After that, whenever a selected event occurs, the filter is called and given the opportunity to process the event.
ISAPI filters are powerful enough to accommodate many different functions, such as those in the following list, within an application:
You can also install multiple filters on the server. The notification order is based on the priority specified by the filter, then the load order in the registry, to resolve any ties. Once a filter has indicated interest in a request, it will get that data whether the request is for a file, a CGI application, or an ISA.
Active Animation (formally known as ActiveVRML; VRML stands for Virtual Reality Modeling Language) is an advanced markup language and a viewer for 3-D multimedia. The Active Animation viewer plugs into the Microsoft Internet Explorer 3.0 as an ActiveX control. Web pages that use ActiveVRML can include interactive 3-D animation and 2-D cel animation, accompanied by synchronized sounds. These effects can also be triggered by events from VBScript and from other languages.
Active Animation synchronizes all media interaction without developers needing to write low-level code. The following is a list of the operations and media types supported by Active Animation:
The ActiveMovie is based on the Microsoft ActiveMovie Streaming Format (.ASF), a new data-independent format for storing and transmitting multimedia content across the Internet. Because ASF files can be streamed, you can begin playback of these files immediately.
ASF is an open and extendible data-independent format for archiving, annotating, indexing, and transmitting synchronized multimedia content. More specifically, with .asf you can combine and store multiple data objects (for example, audio objects, video objects, still images, events, URLs, hypertext markup language (HTML) pages, and programs) into a single synchronized multimedia stream. Its encapsulation feature enables popular media types and formats, such as MPEG, .avi, .wav, and Apple QuickTime, to be synchronized and stored efficiently on a variety of servers.
ASF data is network-transportneutral and can be transmitted over different protocols and networks, including TCP/IP, UDP, RTP, IPX/SPX, and ATM.
ASF also addresses important issues in multimedia-content storage and transmission, such as efficient packaging for multiple network transports, a flexible timing model, support for multiple bit rates, streaming broadcast, error correction and concealment, and the ability to support future media types through dynamic extension.
You can efficiently playback ASF content by using ActiveMovie, Microsoft's next generation, cross-platform video technology for the desktop.
With ActiveX, you can make the most of Internet resources. ActiveX controls and ActiveX scripting give you the infrastructure needed to add language- and tool-independent extensions to Web pages. Using ActiveX Controls lets developers take advantage of existing OLE development tools and the investment they have already made in OLE. ActiveX Scripting allows you to drop any scripting engine into your application, enabling developers to add behavior to Web pages in whatever scripting language they prefer.
ActiveX has also greatly improved extending the HTTP and FTP protocols. The ActiveX IBind interfaces encapsulate a new protocol that supports the concept of binding to a URL dynamically from within your application. An application binds to a URL moniker, which then communicates through the appropriate protocol to activate the OLE object. This abstraction allows newly developed protocols to integrate into your existing objects, independent of your object design or expressed functionality.
Using the Internet Extensions for the Win32 API (WinInet) makes it easy for developers to add Internet access to their applications. WinInet abstracts the protocol-specific details and gives developers a simplified programming interface, so they can add powerful toolbar buttons to access the Internet. For example, a "Go to Home Page" button could be created that would automatically make the necessary protocol requests to connect to the user's home page.
As with most systems, server efficiency and resource use becomes a concern when designing multi-user server applications for the Internet. The Internet Information Server offers a high-performance, secure, and extendible framework. An ISAPI Internet Server Applications is a dynamic link library that loads into the same address space as the HTTP Server component; however, CGI creates a separate process for every work request. Each new process in the CGI model requires more server resources. The advantage of developing an ISA rather than a CGI is high-level performance that requires considerably fewer resources, which frees up resources that can then be used by the server.
The Internet Database Connector allows ODBC database access through an HTTP request. Developers can use this feature to create Web pages with information from the database so they can insert, update, and delete information in the database based on user input and perform other SQL commands.
ISAPI filters can be used to enhance the Microsoft Internet Information Server with custom features, such as enhanced logging of HTTP requests, custom encryption, aliases for URLs, compression schemes, or new authentication methods. The filter applications sit between the client network connection to the HTTP server.
ActiveMovie provides next-generation, cross-platform video; the ActiveMovie Stream Format solves several important synchronization issues in multimedia-content storage and transmission.
Active Animation gives you a powerful foundation for Internet interactive, animated, and multimedia-based content, targeting domains such as advertising, entertainment, online shopping, and technical illustration.
Microsoft is building an infrastructure around the client/server model that enables secure transactions, billing, and user authentication. Most importantly, ActiveX is built on Win32 and OLE, which enables developers to build on their existing investments. ActiveX is the doorway to a whole new world of Internet applications.
The most fundamental model that should be understood before embarking on ActiveX development is the COM (Component Object Model). This model is the same model as discussed in the OLE COM specification.
COM is the "Object Model" for ActiveX and OLE. Microsoft also provides ActiveX Template Library (ATL) so that developers can develop lightweight, fast COM objects. ATL offers a standard way of writing code for every combination of COM interface and data type in an ActiveX component.
Microsoft Visual C++ 4.1 Development Studio integrates several AppWizards, and ActiveX controls to simplify the development process. Along with Visual C++ 4.1 is version 4.1 of the Microsoft Foundation Classes 4.1.
Because we all need to "surf the web" for information useful to our projects, Microsoft Developer Studio has provided a "Web Favorites," which allows developers to access their favorite WWW site from within the Developer's Studio. Through the Web Favorites command on the Help menu, developers can go to one of the preloaded Microsoft Web sites for Visual C++ developer support or any favorite site.
VMRL development is supported through the Template Graphics Software and through Visual C++ custom AppWizard and ActiveX controls. Using these components, developers can easily create Internet applications capable of real-time, three-dimensional walkthroughs through a Web server.
A variety of tools can be used to develop ActiveX components, such as PERL and C for CGI programming, VBScript and JavaScript to glue the ActiveX components together, the ISAPI Internet database connector for database access through ODBC, and Visual Basic as one of many other container applications.
Web server extensions can be developed on an HTTP server, such as the Microsoft Internet Information Server. ISAPI allows Web developers to easily extend Web servers in a fast, scaleable manner. To facilitate developing Web Server Extension applications, Microsoft Visual C++ 4.1 provides the Internet Server API Extension Wizard. The following list of extensions could be made to an HTTP server by using ISAPI:
The ActiveMovie add-on tool kit includes tools to develop applications that handle streamed media. This tool kit allows software developers to integrate real-time audio and video content in virtually any type of application.
Active Animation and Active Movie controls can be manipulated through VBScript. A developer can glue the control's functions together without the need for complex stream synchronization methods.
ActiveX is a technology that has the potential to change the way information is accessed and used on the Internet. Powerful abstractions based on OLE have been developed that enable fast, scaleable integration of your objects within the Internet. Microsoft is making a major effort to make the Internet everything it can possibly be. By using ActiveX, developers can make the best use of their system resources while providing instant, dynamic content and functionality in their Internet applications. How information is presented greatly affects how interesting and usable people find it.