ActiveX Controls

Updated: May 24, 1996

What is an "ActiveX control"?
ActiveX controls included in Microsoft Internet Explorer 3.0
ActiveX controls available from other companies
How to start writing ActiveX controls

Also see the FAQ on developing Web pages using ActiveX controls.



What is an "ActiveX control"?

ActiveX™ controls, formerly known as OLE controls or OCX controls, are components (or objects) you can insert into a Web page or other application to reuse packaged functionality someone else programmed. For example, the ActiveX controls that are included with Microsoft® Internet Explorer version 3.0 allow you to enhance your Web pages with sophisticated formatting features and animation.

A key advantage of ActiveX controls over Java applets and Netscape™ plug-ins is that ActiveX controls can also be used in applications written in many programming languages, including all of the Microsoft programming and database languages.

There are literally hundreds of ActiveX controls available today with functionality ranging from a timer control (which simply notifies its container at a particular time) to full-featured spreadsheets and word processors. If you can imagine it, you can do it with an ActiveX control.

You can add ActiveX controls to your Web pages by using the standard HTML <OBJECT> tag. The object tag includes a set of parameters that you use to specify which data the control should use and to control the appearance and behavior of the control.

Microsoft Internet Explorer version 3.0 comes with a small set of ActiveX controls that it uses. With these controls, you can:

The ActiveX controls that are provided with Internet Explorer 3.0 are installed automatically when the user installs Internet Explorer 3.0. Once installed, ActiveX controls run automatically when a Web page containing them is displayed--users do not need to download any additional files.

If you're a Web author, you can take advantage of the ready-to-use ActiveX controls included with Internet Explorer 3.0. If you're a programmer, you can write your own controls using Visual C++® and one of the ActiveX control frameworks: the Microsoft Foundation Class Library (MFC), the ActiveX Template Library (ATL), or the BaseCtl framework.



ActiveX controls included in Microsoft Internet Explorer 3.0

Microsoft Internet Explorer version 3.0 includes controls such as Chart, Label, New Item, Preloader, and Timer, which you can easily add to your Web pages with the <OBJECT> tag. See the ActiveX Galleryfor detailed descriptions and full syntax for these controls, as well as a selection of ActiveX controls from other companies.


ActiveX controls available from other companies

See the Control Freaks pageinternet link on the Component Builders site for a selection of ActiveX controls available from other companies.



How to start writing ActiveX controls

ActiveX controls are OLE controls that have been extended for the Internet environment. The specs in the ActiveX Development Kit provide background information on ActiveX controls and some preliminary information on writing controls.

There are three basic ways to write ActiveX controls today:

The easiest is to use the OLE control development facilities built into Visual C++ and MFC. This technology allows you to create control executables that are pretty small (so they download faster); however, it requires the correct MFC dynamic link library (DLL) to be installed on the user's system. This DLL is quite large--nearly a megabyte. But even so, it needs to be installed only once on each user's system and shouldn't take more than 10 minutes or so to download, even at 14.4 Kbps. Microsoft is working to make these controls and their associated DLLs even smaller and more efficient, so controls you write using MFC today will be even faster in the future.

The Microsoft Internet Explorer developers included a sample called BaseCtl in the ActiveX Development Kit. This sample comprises the FrameWrk, ToDoSvr, and WebImage examples. Writing your controls in this style gives you the smallest possible controls; however, it also requires intimate knowledge of OLE COM and ActiveX control architecture--so it's not for the faint-of-heart.

Finally, the Visual C++ team has created the ActiveX Template Library (ATL)internet link, which includes the library plus the Beeper and Labrador samples. This is a library of C++ templates that allows you to create very fast and small controls--in fact, you can even avoid linking in the C run-time library. The templates also do some of the grunge work of OLE for you, but they still require a pretty intimate knowledge of COM and ActiveX control architecture--so they're for those who aren't timid, but who'd like to have some of the tedious OLE work done for them.

For answers to frequently asked questions about using controls on your Web pages, please see the FAQ on developing Web pages using ActiveX controls.

© 1996 Microsoft Corporation