Contents
Overview 1
Introduction to Active Components 2
List of ActiveX Controls 9
Working With ActiveX Controls 11
ActiveX Control Security 21
Other Active Components 22
Lab 7: Adding Active Components 28
Review 31
Module 7: Adding Active
Components
Information in this document is subject to change without notice. The names of companies,
products, people, characters, and/or data mentioned herein are fictitious and are in no way intended
to represent any real individual, company, product, or event, unless otherwise noted. Complying
with all applicable copyright laws is the responsibility of the user. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Microsoft Corporation. If, however, your only
means of access is electronic, permission to print one copy is hereby granted.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.
2000 Microsoft Corporation. All rights reserved.
Microsoft, ActiveX, Authenticode, BackOffice, Internet Explorer, Internet Information Server,
FrontPage, MS-DOS, Notepad, Visual Basic, Visual FoxPro, Visual C++, Visual J++, Windows,
and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the
U.S.A. and/or other countries.
The names of companies, products, people, characters, and/or data mentioned herein are fictitious
and are in no way intended to represent any real individual, company, product, or event, unless
otherwise noted.
Other product and company names mentioned herein may be the trademarks of their respective
owners.
Program Manager: Steve Merrill
Development Lead: Basabjit Chakrabarty (NIIT)
Instructional Designers: Sangeeta Nair, Vijayalakshmi Narayanaswamy (NIIT); Veena Nambier,
Yatinder Walia (NIIT)
Technical Contributors: Scott Swigart (3 Leaf Solutions); Gary Gumbiner (Great Barrier
Technologies, Inc.)
Graphic Artist: Scott Serna (Creative Assets)
Editing Manager: Jennifer Linn
Editor: Reid Bannecker
Production Manager: Miracle Davis
Production Coordinator: Linda Lu Cannon (The Write Stuff)
Build Coordinator: Eric Wagoner
Testing Lead: Eric Meyers
Testing: Bryan Urakawa, Chris and Edward
Lead Product Manager, Internet Services: Hilary Vandal
Manufacturing Manager: Rick Terek
Operations Coordinator: John Williams
Manufacturing Support: Laura King; Kathy Hershey
Lead Product Manager, Release Management: Bo Galford
Group Manager, Courseware Infrastructure: David Bramble
General Manager: Robert Stewart
Module 7: Adding Active Components iii
Instructor Notes
This module introduces students to the concept of active components, such as
ActiveX controls and Java applets. Students will learn how to add an ActiveX
control to a Web page Microsoft FrontPage 2000. Students will also learn to
send data from an ActiveX control to an ASP file running on a server. Finally,
this module gives an overview of building ActiveX controls.
After completing this module, students will be able to:
!
Describe the ActiveX control architecture.
!
Add an ActiveX control to a Web page using FrontPage 2000.
!
Describe how Internet Component Download functions.
!
Identify the tools available for building ActiveX controls.
!
Send data from an ActiveX control to a server.
!
Differentiate between ActiveX controls and Java applets.
Materials and Preparation
This section provides you with the required materials and preparation tasks that
are needed to teach this module.
Required Materials
To teach this module, you need the following materials:
!
Microsoft PowerPoint file 1912A_07.ppt
!
Module 7, “Adding Active Components”
!
Lab 7, “Adding Active Components”
Preparation Tasks
To prepare for this module, you should:
!
Read all of the materials for this module.
!
Complete the lab.
Presentation:
60 Minutes
Lab:
30 Minutes
iv Module 7: Adding Active Components
Module Strategy
Use the following strategy to present this module:
!
Introduction to Active Components
Explain ActiveX controls and their sources.
!
Listing of ActiveX Controls
In this topic, students will learn about the ActiveX controls that are included
with Internet Explorer, Office, Access, as well as other ActiveX controls
available from Microsoft.
!
Working with ActiveX Controls
First, explain the ActiveX control architecture. Then, demonstrate how to
add an ActiveX control to a Web page using FrontPage 2000. Then, explain
the <OBJECT> tag and the CODEBASE attribute. Next, explain how to set
design-time properties for an ActiveX control. Then, explain Internet
Component Download. Finally, explain how to build ActiveX controls.
!
ActiveX Control Security
This topic covers the security issues associated with the use of ActiveX
controls.
!
Other Active Components
This topic introduces Java Applets. Then, students do a practice on adding a
Java applet to a page using FrontPage 2000. It also compares ActiveX
controls to Java Applets.
Module 7: Adding Active Components 1
#
##
#
Overview
!
Introduction to Active Components
!
List of ActiveX Controls
!
Working with ActiveX Controls
!
ActiveX Control Security
!
Other Active Components
!
Lab: Adding Active Components
!
Review
Objects, such as Microsoft
®
ActiveX
®
controls and Java applets, play an
important role in making the content on your Web site interactive. For example,
you can enhance the user interface of any Web page by adding an ActiveX
control, a Java applet, or both.
ActiveX controls are components that use the COM technology to provide
interoperability among objects. ActiveX controls are the third version of Object
Linking and Embedding (OLE) controls, which provide enhancements that are
specifically designed to facilitate distribution of components.
In this section, you will learn about active components. You will also learn
about downloading and adding an ActiveX control to a Web page. Finally, you
will learn the differences between ActiveX controls and Java applets.
After completing this module, you will be able to:
!
Describe the ActiveX control architecture.
!
Add an ActiveX control to a Web page using Microsoft FrontPage
®
2000.
!
Describe how Internet Component Download functions.
!
Identify the tools available for building ActiveX controls.
!
Send data from an ActiveX control to a server.
!
Differentiate between ActiveX controls and Java applets.
Slide Objective
To provide an overview of
the module topics and
objectives.
Lead-in
In this module, you will learn
about active components,
such as ActiveX controls
and Java applets. You will
also learn to add an ActiveX
control to a Web page.
2 Module 7: Adding Active Components
#
##
#
Introduction to Active Components
!
Applications of ActiveX Controls
!
What are ActiveX Controls?
!
Sources of ActiveX Controls
In programming, a component is a discrete part of a larger program. Usually, a
component provides a specific function or a group of related functions.
In object oriented programming and distributed object technology, a component
is a reusable block of code that can be combined with other components stored
in computers in a distributed network to form an application. Examples of a
component include a button in a graphical user interface, a calculator, or an
interface to a database manager. You can deploy components on different
servers in a network to communicate with each other for services. A component
runs within the context of a container. Examples of containers include Web
pages, Web browsers, and word processors.
An ActiveX control is a component that can be reused by programs within a
computer or even among computers on a network. You can also create your
own ActiveX controls.
Slide Objective
To provide an overview of
Active components.
Lead-in
A component is a reusable
piece of code that is a part
of a larger program.
Module 7: Adding Active Components 3
Applications of ActiveX Controls
!
Popular ActiveX controls
$
Calendar
$
Chart
$
Label
(View calendar.htm from Sampapps)
You can use an ActiveX control in your Web site as a small program or an
animation. For example, you can download ActiveX controls from the Internet
and use them in your Web pages to display a calendar, an animation, or a
simple chart.
The Calendar control can be used in a Web page to display a calendar. It can be
used to show the current date and also select a date for a particular field in a
Web page. For example, the Calendar control can be used in a Web page that
requires the user to specify a date.
Slide Objective
To provide an overview of
the applications of ActiveX
controls.
Lead-in
ActiveX controls have a
variety of applications.
Delivery Tip
Open the file calendar.htm
from the
\Inetpub\wwwroot\1912\Sam
papps\Ch07 folder in
Internet Explorer.
4 Module 7: Adding Active Components
Applications of ActiveX Controls (continued)
(View WindowsMedia.htm from Sampapps)
You can add animations to a Web page by using ActiveX controls that can be
downloaded as animations.
Slide Objective
To show the use of an
animation in a Web page.
Delivery Tip
Open the file
WindowsMedia.htm from
the
\Inetpub\wwwroot\1912\Sam
papps\Ch07 folder in
Internet Explorer.
Module 7: Adding Active Components 5
Applications of ActiveX Controls (continued)
(View Chart.htm from Sampapps)
The Chart control can be used in a Web page to display graphical information.
Slide Objective
To show the use of the
Chart control in a Web
page.
Delivery Tip
Open the file Chart.htm
from the
\Inetpub\wwwroot\1912\Sam
papps\Ch07 in Internet
Explorer.
6 Module 7: Adding Active Components
What Are ActiveX Controls?
!
ActiveX Controls
$
Reusable Components
$
Multiple Language Support
$
Add Functionality to Pages
!
Elements of ActiveX Controls
$
ActiveX Documents
$
Active Scripting Controls
$
Java Virtual machine (JVM)
$
ActiveX Server Framework
ActiveX is based on the Component Object Model (COM). With its integrated
services, COM forms the foundation for developers to create powerful
component-based applications. ActiveX enables software components to
interoperate across networks. ActiveX controls are reusable components and
provide multiple language support.
ActiveX controls
ActiveX controls can be downloaded as small programs for use in Web pages.
These controls can also be used for any commonly performed task by an
application program in the latest Microsoft Windows
®
environments.
ActiveX controls add functionality to Web pages. For example, you can add an
ActiveX control to a Web page for features, such as charts, animations, or
audio. You can create ActiveX controls using a variety of programming
languages, such as Microsoft Visual Basic
®
, Microsoft Visual C++
®
, and
Microsoft Access.
ActiveX controls are browser dependent. Currently, only Microsoft
Internet Explorer 3.0 and later support ActiveX controls.
Slide Objective
To describe ActiveX
controls.
Lead-in
ActiveX is a technology
developed by Microsoft,
which enables developers to
create applications by using
components.
Delivery Tip
Ask students to open the file
Chart.htm from
\Inetpub\wwwroot\1912\Sam
papps\Ch07. Tell them that
in the displayed Web page,
an ActiveX control, Chart,
has been added to
graphically display a
corporate sales growth. This
adds functionality to the
Web page. Also, tell them
where all they can use this
control and that there are
ActiveX controls that also
provide animations and
audio in a Web page.
Note
Module 7: Adding Active Components 7
Elements of ActiveX controls
ActiveX controls include both client- and server-side technologies. Examples of
these technologies are ActiveX documents, Active Scripting controls, Java
Virtual Machine (JVM), and ActiveX Server Framework.
!
ActiveX documents enable users to view non-HTML documents, such as
Microsoft Excel, using a Web browser.
!
Active Scripting controls are the integrated behavior of several ActiveX
controls from a Web browser or Web server.
!
JVM enables any ActiveX-supported browser, such as Internet Explorer, to
run Java applets and integrate Java applets with ActiveX controls.
!
ActiveX Server Framework provides Web server-based functions, such as
security and database access.
You can set the security level for a zone in the Security tab of the
Internet Options dialog box to ensure that no unsigned ActiveX control is
downloaded. This prevents from accidental loss of data from the system.
Note
8 Module 7: Adding Active Components
Sources of ActiveX Controls
!
ActiveX Controls Sources
$
www.activex.com
$
www.cnet.com
$
www.eu.microsoft.com/officedev/articles/odept1.htm
$
www.eu.microsoft.com/OfficeDev/articles/odept2.htm
$
ActiveX controls are shipped with Microsoft Internet
Explorer
$
ActiveX controls are shipped with Microsoft Office
$
ActiveX controls are shipped with Microsoft Access
There are many Web sites that offer ActiveX controls you can download and
use in your Web site. Other sources of ActiveX controls include third-party
vendors and custom-built controls that are developed for different applications.
ActiveX controls run in the same memory space as the browser and must be
downloaded and registered on the client machine. After an ActiveX control is
downloaded and registered in the Windows Registry, it can be used by any
application that supports ActiveX controls. After identifying the required
functionality, you can select the ActiveX control that provides that functionality
and then simply drop the control into your Web page.
The Microsoft site contains many Web pages that host several ActiveX
controls. You can use these ActiveX controls in your Web site.
For ActiveX controls, which you can incorporate into your Web pages,
go to:
!
!
To download an ActiveX control onto your computer:
1. Review the pages, and locate an ActiveX control that you want to
incorporate into your Web page.
2. Follow the directions on the site for downloading the ActiveX control to
your computer.
3. Once the control has been downloaded, in the Microsoft Internet Explorer
window, click File.
4. Click Exit to close Microsoft Internet Explorer.
You now have the control on your computer, and you can incorporate it into
your Web page.
Slide Objective
To find sources for ActiveX
controls.
Lead-in
There are various sites on
the Internet that host
ActiveX controls for use.
Note
Delivery Tip
Describe the procedure to
download an ActiveX
control.
Module 7: Adding Active Components 9
List of ActiveX Controls
!
ActiveX Controls Shipped with Internet Explorer
!
ActiveX Controls Shipped with Office
!
ActiveX Controls Shipped with Access
!
ActiveX Controls from the Microsoft site
(View from Sampapps)
odept1.htm, odept2.htm,
Access ActiveX Controls.htm,
Standard ActiveX Controls.htm
ActiveX Controlls and Visual FoxPro 5_0.htm
The following controls are shipped with Microsoft Internet Explorer 3.0 and
above:
!
Animated Button
!
Popup Menu
!
Chart
!
Popup Window
!
Gradient
!
Preloader
!
Label
!
Ticker
!
Marquee
!
Timer
!
Menu
!
View Tracker
The following controls are shipped with Microsoft Office:
!
CommonDialog
!
StatusBar
!
ImageList
!
TabStrip
!
InternetTransfer
!
Toolbar
!
ListView
!
TreeView
!
ProgressBar
!
UpDown
!
RichTextBox
!
Winsock
!
Slider
The following is one of the controls shipped with Access:
!
Calendar
Slide Objective
To list ActiveX controls that
are shipped with Microsoft
products.
Lead-in
Microsoft provides ActiveX
controls in a variety of ways.
For example, some ActiveX
controls are shipped along
with Microsoft products,
whereas others are
available from the Microsoft
site.
Delivery Tip
Explain the purpose of each
control.
Delivery Tip
Open the files odept1.htm
and odept2.htm from the
\Inetpub\wwwroot\1912\Sam
pleapps\Ch07folder in
Internet Explorer. Explain
the purpose of each control
from the Web pages that are
open.
10 Module 7: Adding Active Components
Microsoft Office 97 and later versions of Office install several Microsoft
Forms 2.0 controls. Although these ActiveX controls work in Microsoft
Access 97 and later versions of Access, the native Microsoft Access form
and report controls provide more functionality and will function more
quickly than their ActiveX equivalents.
There are other ActiveX controls that are available on the Microsoft Web
site. These include the standard ActiveX controls and the ActiveX
controls included with Microsoft Visual FoxPro
®
5.0.
Delivery Tip
Open the file Access
ActiveX Controls.htm from
\Inetpub\wwwroot\1912\Sam
papps\Ch07 folder in
Internet Explorer. Explain
the purpose of each control
from the Web page that is
open.
Delivery Tip
Open the files Standard
ActiveX Controls.htm and
ActiveX Controls and
Visual FoxPro 5_0.htm
from the
\Inetpub\wwwroot\1912\Sam
papps\Ch07 folder in
Internet Explorer.