This documentation is archived and is not being maintained.

Embedding a Signed CAB File on a Web Page

ATL and MFC controls are embedded in Web pages using the <OBJECT> tag. Within the <OBJECT> tag, you need to specify three attributes for the control:

  • ID   The name of the control
  • CLASSID   The CLSID of the control
  • CODEBASE   The location from which to download the control. Note that CODEBASE can point at a number of different file types successfully.

As an example, the following Web page displays the ATL Polygon control archived in the CAB file created in the section on Creating an INF File. The address should be replaced with the actual HTTP address of the CAB file:

<TITLE>ATL 2.0 test page for object PolyCtl</TITLE>
<OBJECT ID="PolyCtl" 
Sub PolyCtl_ClickIn(x, y)
PolyCtl.Sides = PolyCtl.Sides + 1
End Sub
Sub PolyCtl_ClickOut(x, y)
PolyCtl.Sides = PolyCtl.Sides - 1
End Sub

CODEBASE can point directly to an OCX or DLL file:


Since this causes only the DLL or OCX file to be downloaded and installed, any necessary supporting DLLs must already be on the client machine.

If you include the optional version number with a CAB file, the version number should refer to the control being downloaded. For example, since POLYGON.DLL has a version number of 1, 0, 0, 1, the version for the CAB is also 1, 0, 0, 1:


If you do not include the version number, older versions of the same control will not be replaced if they are found on the client machine.

See Also

Creating Signed CAB Files for MFC and ATL Controls