Windows NT Internet and Intranet Development

To learn more about author Sanjaya Hettihewa, please visit the author's homepage.

Previous chapterNext chapterContents


- 24 -

Introduction to ActiveX Controls


ActiveX is a powerful Web-component architecture and is a core technology of Microsoft's Internet strategy. ActiveX can be used to easily develop sophisticated Web applications. The capabilities of ActiveX can be put to use in Internet as well as intranet environments. This chapter provides a very brief overview of ActiveX and discusses how its capabilities can be put to use. Some components of ActiveX were formerly known as OLE (Object Linking and Embedding) components. It is important that you realize the potential and power of ActiveX technologies and how they can work for you. ActiveX includes ActiveX controls, ActiveX scripting, ActiveX documents, and the ActiveX Server Framework. Each of these components has been designed and fine-tuned to address a certain aspect of Web publishing.


URL:Visit the Microsoft Site Builder Workshop to learn more about ActiveX technologies.


URL:Visit the Microsoft ActiveX Control Gallery to locate ActiveX controls that can be incorporated into your Web site.

http://www.microsoft.com/activex/gallery/

Figure 24.1. An ActiveX document viewed with Internet Explorer.


ActiveX Control Compatibility Issues

ActiveX controls are cross-language, cross-browser, and cross-platform. ActiveX controls can be generated with programming languages such as C++, Visual Basic, and Java. By the time you read this, Microsoft should have an ActiveX version of Internet Explorer for Macintosh, and a UNIX version should be released sometime during the second quarter of 1997.

Netscape Navigator does not natively support ActiveX controls or ActiveX scripting. However, a Netscape plug-in developed by NCompass Labs can be used by Netscape Navigator users to browse ActiveX Web pages. Visit the following Web site for additional information about the NCompass plug-in.


URL:The NCompass plug-in allows Netscape Navigator users to browse ActiveX Web pages.

http://www.ncompasslabs.com/


ActiveX Security Issues

Microsoft Internet Explorer implements ActiveX security by providing a mechanism to digitally sign ActiveX controls. Users can then examine the source of an ActiveX control before it is executed by Internet Explorer. If an ActiveX control is not digitally signed, Internet Explorer warns the user about the potential safety violations associated with unsigned ActiveX controls by displaying a dialog box similar to the one shown in Figure 24.2.

Figure 24.2. Internet Explorer warns about the potential safety violations associated with unsigned ActiveX controls.


URL:Visit the Microsoft Authenticode Technology Web page to learn how security is implemented in ActiveX controls by providing accountability for software downloaded over the Internet.

http://www.microsoft.com/intdev/security/misf8-f.htm

Using ActiveX Controls in Web Pages

ActiveX controls are embedded in Web pages using the <OBJECT></OBJECT> tag (as shown in lines 7-17 of Listing 24.1). The <object> tag contains the universal class ID of the ActiveX control, along with various parameters. See Figure 24.3 for the Web page generated by the HTML code in Listing 24.1. Lines 7-17 of the HTML code in Listing 24.1 insert the ActiveX Calendar control into a Web page.

Listing 24.1. Using the <OBJECT> </OBJECT> tag.

 1: <HTML>
 2: <HEAD>
 3: <TITLE>Using ActiveX Controls</TITLE>
 4: </HEAD>
 5: <BODY BGCOLOR=FFFFFF>
 6:
 7: <OBJECT ID="Calendar1" WIDTH=372 HEIGHT=279
 8:  CLASSID="CLSID:8E27C92B-1264-101C-8A2F-040224009C02">
 9:     <PARAM NAME="_Version" VALUE="524288">
10:     <PARAM NAME="_ExtentX" VALUE="9843">
11:     <PARAM NAME="_ExtentY" VALUE="7382">
12:     <PARAM NAME="_StockProps" VALUE="1">
13:     <PARAM NAME="BackColor" VALUE="12632256">
14:     <PARAM NAME="Year" VALUE="1996">
15:     <PARAM NAME="Month" VALUE="11">
16:     <PARAM NAME="Day" VALUE="7">
17: </OBJECT>
18:
19: </BODY>
20: </HTML>

Figure 24.3. An ActiveX control embedded in a Web page.


Summary

ActiveX controls can be thought of as Web-application components that can be linked with other ActiveX controls to develop complex Web applications. By themselves, ActiveX controls have limited capabilities. However, client-side scripting languages can be used to glue ActiveX controls together and create useful Web applications. For example, by themselves, a Calendar control and a Text Box control do very little. However, VBScript can be used to link the two controls by allowing the user to view the days of a month simply by typing the year and month in the Text Box control.


Previous chapterNext chapterContents


© Copyright, Macmillan Computer Publishing. All rights reserved.