The OBJECT Tag

Preparing to Use ActiveX Controls

The CODEBASE attribute for the <OBJECT> tag contains an absolute or relative URL that points to the .ocx file for a given control.

Setting the CODEBASE Attribute

If an ActiveX control does not rely on any files other than the .ocx file, you can specify the location of the .ocx file with the CODEBASE attribute.

Example

This example downloads an ActiveX control by referencing the .ocx file:
 <OBJECT CLASSID="clsid:99B42120-6EC7-11CF-A6C7-00AA00A47DD2" CODEBASE="http://server/control.ocx"> </OBJECT> 

If an ActiveX control relies on additional DLLs to run, you must supply a .cab file that contains all necessary files, and an .inf file that specifies where to install each of the files.

Example

This example downloads and installs an ActiveX control by referencing a .cab file:
 <OBJECT CLASSID="clsid:99B42120-6EC7-11CF-A6C7-00AA00A47DD2 CODEBASE="http://server/control.cab"> </OBJECT> 

Specifying a Version Number

The CODEBASE attribute also enables you to include a version number to make sure that users download only a specific version of a control.

Example

This example uses the CODEBASE attribute to specify a version number of 4.70.1165 in the pop-up menu control:
 <OBJECT  CLASSID="CLSID:7823A620-9DD9-11CF-A662-00AA00C066D2" CODEBASE="iemenu.ocx#Version=4,70,0,1165"> 

The format of the version number is N,N,N,N . If you do not specify a version number, Internet Explorer will use any version of the control that is installed on the user's computer. However, to make sure that a control always downloads onto the user 's computer, specify a version number of -1,-1,-1,-1 .

* To determine the version number of a control

  1. Right-click the Mscal.ocx file in Windows Explorer, and then click Properties .

    This file should be located in your Windows System directory.

  2. In the Properties dialog box, click the Version tab and then locate the version number.


Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net