Article ID: 165075 - Last Review: December 21, 2006 - Revision: 2.5 How To Download Dependent DLLs in Internet Explorer with an .inf FileThis article was previously published under Q165075 SUMMARY
It is often necessary to download dependent DLLs along with an ActiveX
Control. MFC and Visual Basic controls have this requirement. This article
will explain three ways that you can do this.
MORE INFORMATION
There are three ways to include dependent DLLs in the download for a
control. The first way is to include the DLL(s) in the CAB file for the
control along with the OCX and INF files. The downside of this is that the
DLL will be downloaded any time the control is downloaded. In some cases,
this is appropriate. The next way is to package the dependent DLL(s) in a
separate CAB file and refer to that in the INF file for the control. The
third way also packages the DLL in a separate CAB file but the CAB file is
referred to in the control's INF file with a hook. Using a hook allows the
download process to execute an INF or EXE file contained in the dependent
CAB file.
To add a dependency for an OCX (Simpdll.dll in this example), a section similar to the section for the control is added to the [AddCode] section of the INF file: To include the DLL in a separate CAB file, all that is necessary is to change the location from "thiscab" to the URL at which the dependent CAB will be located:
file-win32-x86=http://www.contoso.com/controls/dependent.cab
In this case, Simpdll.cab contains only simpdll.dll.
Multiple DLLs can be added to the INF and CAB files above if necessary. The third way to package dependent DLLs is to refer to the dependent DLL's CAB file using a hook. With this technique, an INF or EXE file in the dependent CAB can be executed on download. The following section from an .inf file controls the dependent DLL download for MFC controls: To illustrate, the following is the .inf file used to install the dependent MFC DLLs. You can modify this to install your own DLLs in the same way that the MFC DLLs are installed. Beware, however, that running Regsvr32 on the DLL may have undesirable side effects. When DllRegisterServer is called, it makes appropriate registry entries pointing to the DLL location on the machine. For example, typing the following in an MS-DOS prompt, for test purposes, can cause problems: Installing a DLL with a hook and a self extracting EXE is useful for the following reason: If a DLL that needs to be upgraded is already loaded in memory, the download will fail. This is a known problem, which has been fixed in Internet Explorer version 4.0. Internet Explorer 4.0 will suggest a reboot and load the new DLL during the reboot. REFERENCES
For additional information, please see the following
articles in the Microsoft Knowledge Base:
167158
(http://support.microsoft.com/kb/167158/EN-US/
)
How To Package MFC Controls for Use Over the Internet
167597
(http://support.microsoft.com/kb/167597/EN-US/
)
Specifying FileVersion and #Version for Component Download
For more information, see the following Webcast: How Does Internet Component Download Work?
(http://support.microsoft.com/?scid=http%3a%2f%2fsupport.microsoft.com%2fservicedesks%2fwebcasts%2fwc042500%2fwc042500.asp)
APPLIES TO
| Article Translations
|
Back to the top
