For instance, CODEBASE can point directly to an .ocx file as follows:
Another alternative is for CODEBASE to point to an .inf file, for example:
The best solution is for CODEBASE to point to a cabinet file. With this method, supporting DLLs can be referenced and the cabinet file signed.
NOTE: If the directions below for referencing the MFC DLLs are followed, the MFC DLLs will not be downloaded if they already exist on the client. The CODEBASE line will resemble the following:
Cab Packaging OverviewIn the Cabinet Software Development Kit (also called Cabinet SDK, or CAB Development Kit) you will find the necessary tools to construct cabinet (.cab) files. See the following Microsoft Web site:
The OBJECT tag to include the Spindial control in a Web page resembles the following:
<OBJECT ID="Spindial1" WIDTH=200 HEIGHT=200
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0">
<PARAM NAME="NeedlePosition" VALUE="2">
The following is an example .inf for the MFC Spindial control. This .inf file can be modified to download any MFC ActiveX Control by changing Spindial's information to the desired MFC ActiveX Control's information. See comments below.
C:\CabDevKit\cabarc.exe N spindial.cab spindial.ocx spindial.inf
; ========================= spindial.inf ========================
; This .inf file will control the installation of the MFC Spindial
; control. This control has been compiled with Visual C++ version 4.2.
; The FileVersion tags in the dependent DLLs section on this file
; reflect this requirement.
; version signature (same for both NT and Win95) do not remove
; These are the necessary supporting DLLs for MFC 4.2 ActiveX Controls
; thiscab is a keyword which, in this case, means that Spindial.ocx
; can be found in the same .cab file as this .inf file
; file-win32-x86 is an x86 platform specific identifier
; See the ActiveX SDK - ActiveX Controls - Internet Component Download -
; Packaging component code for automatic download
; *** add your controls CLSID here ***
; Add your ocx's file version here.
; dependent DLLs
; This is an example of conditional hook. The hook only gets processed
; if msvcrt.dll of the specified version is absent on client machine.
; If dependent DLLs are packaged directly into the above cabinet file
; along with an .inf file, specify that .inf file to run as follows:
; The mfc42.cab file actually contains a self extracting executable.
; In this case we specify a run= command.
; ====================== end of spindial.inf =====================
- Any reference to spindial should be changed to the name of your control. This includes comments and the following:
- The following should be changed to the correct CLSID and FileVersion for your control:The CLSID above can be obtained for your control from the control's ODL file. The CLSID is associated with the coclass for the control. For instance, the above CLSID was obtained from the following section of Spindial.odl:
FileVersion=1,0,0,001The FileVersion for the control can be obtained from the version resource for the control. As is true of any file with a version resource, this can be obtained by opening the file (Spindial.ocx in this case ) version resource with Visual Studio. From the File menu, select Open, and click Open as: Resources. Open the Version resource; the FileVersion that you are interested in is listed after FILEVERSION.
helpstring("Spindial Control"), control ]
- The last change that you need to make is to enter the correct FileVersion for each of the MFC DLLs, [mfc42.dll], [olepro32.dll], and [mscvrt.dll]. Note that if you are using Visual C++ 4.1 or earlier, you need to change any reference to Mfc42.dll to Mfc40.dll and any reference to Msvcrt.dll to Msvcrt40.dll.
VC 4.1 and earlier, use:
VC 4.2b and earlier, use:
VC 5.0, use:
VC 5.0sp1, use:
VC 5.0sp2, use:
VC 5.0sp3, use:
VC 6.0, use:
Notice that all versions of MFC between 4.2 and 6.0 use Mfc42.cab. This .cab file always contains the latest version of the DLLs because they are backward-compatible. If you are not compiling with a later build of MFC, you may not want to specify the latest FileVersion. Doing so may trigger an unnecessary download of the MFC DLLs.
Article ID: 167158 - Last Review: Jun 22, 2014 - Revision: 1