|
To access the contents, click the chapter and section titles.
Sams Teach Yourself Visual J++ 6 in 21 Days
ActiveXSeveral years ago, COM and OLE were the big programming buzzwords. Now, the word ActiveX is thrown around by programmers like celebrity names at a Hollywood party. When Microsoft recently turned its attention to the Internet, it occurred to the powers-that-be at the big M that there was no reason the Internet should not be treated as just another peripheral like a disk drive or CD-ROM drive. Why not make the Internet so accessible from the users computer that it seemed to become part of the operating system? With this idea came the necessity of extending OLE 2.0 so that it encompassed not just the users local system, but also any network to which the local system was connected. ActiveX was born. ActiveX could have been called OLE 3.0, but the capabilities of OLE had gone so far beyond object linking and embedding that the original moniker was more confusing than descriptive. So Microsoft named this newly expanded technology ActiveX. Now, virtually everywhere the word OLE is used, the word ActiveX is substituted. For example, OLE components are now ActiveX components; OLE controls are now ActiveX controls, and OLE documents are now ActiveX documents. All of these objects that share the word ActiveX in their names are more powerful than their old OLE counterparts, however. They are now objects that expand the original OLE concepts to the Web. ActiveX controls, for example, can be placed in Web pages and transmitted automatically to the browser thats viewing the Web page. ActiveX documents, too, are much more powerful than OLE documents. Not only can these objects be transmitted over the Web, ActiveX documents also tell the receiving browser how the document should be displayed. You can think of an ActiveX document as being a storage object for information that can be interpreted, displayed, and manipulated by a receiving application. ActiveX Applications and ComponentsAn ActiveX container is an application that contains linked or embedded data. Such an application must be able to display the linked or embedded data as well as enable the user to select, move, delete, and edit the data. When Microsoft Word contains linked or embedded data, its acting as an ActiveX container. Many Windows applications support ActiveX in this way. Suppose we use Microsoft Word as a container application. The graphic embedded in the Word document could have been created with Microsoft Paint, which makes Paint the server application. To edit the embedded graphic, the user can double-click the item. The server then should respond in one of two ways: by opening the graphic in a separate editing window or by merging its user interface with Words. The server response depends on how the client and server were programmed. If the applications support in-place editing (recommended), ActiveX merges the servers toolbars and menus with the container applications. This enables the user to edit the item without switching windows or applications. The user can edit the graphic as if the graphic were loaded into Paint. Because ActiveX makes all of Paints tools available in the toolbar, adding the ellipses takes only seconds. Just as you have containers and servers with object linking and embedding, so you have automation clients and automation servers with ActiveX automation. An automation-client application reaches out in the system to control a component of another application, called the automation server. Of course, the process isnt quite that simple. Both applications must be specially programmed to take advantage of ActiveX automation. For example, an application that hasnt been programmed to be an automation client cannot access programmable objects made available by an automation server. Conversely, an application that hasnt been programmed as an automation server cannot share its functionality with other applications in the system, even if the other applications support ActiveX automation. Creating automation servers means defining interfaces that provide access to properties and methods of the programmable objects supplied by the server. On the client side, when an application wants to access a programmable object, it must know how to obtain a reference to the objects interface, as well as how to manage the objects properties and call the objects methods. For example, reusing the spell-checker example, an application that wanted to take advantage of another applications spell checker (assuming that the spell checker is a programmable object) would acquire a reference to the spell checkers interface and call the spell checkers functions through that interface. ActiveX controls are like mini-applications that you can embed into other applications. They take the idea of programmable components and separate those components from the server. That is, ActiveX components are complete entities unto themselves and do not need to be managed by a server application. One of the biggest advantages of ActiveX controls is their capability to provide computing power to Web pages on the Internet. In this way, ActiveX controls can act much like Java applets. Virtually any type of program you can conceive of can be programmed as an ActiveX control and included in a Web page.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |