Microsoft KB Archive/169438

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft ActiveX SDK, version 1.0
 * Microsoft Internet Explorer (Programming) versions 3.0, 3.01, 3.02, 4.0, 5.0

-

SYMPTOMS
In some cases an ActiveX control embedded on a Web page shows up in Internet Explorer as a white box with a red x in it. In other cases, the control does not display at all.

CAUSE
This problem can be caused by any one of the following:


 * Missing dependent DLLs used by the ActiveX control
 * Missing .lpk file when using a licensed ActiveX control
 * ActiveX control contains other licensed controls requiring run-time license
 * Missing CODEBASE attribute in the ActiveX control's  tag

Missing Dependent DLLs Used by the ActiveX Control
For a C++ control written in MFC, be sure to package the correct version of the MFC DLLs with the control, specifying them in the .inf file.

For additional information, please see the following article in the Microsoft Knowledge Base: "Q167158 How to Package MFC Controls For Use Over the Internet"

For a Visual Basic control, be sure to package the correct version of the VB run-time DLLs with the control. For example, a typical Visual Basic 5.0 control requires two .cab files to be packaged with the control: Asycfilt.cab and Msvbvm50.cab. The .inf file for a VB5 control (in this example, Simple.ocx) that correctly packages these two DLLs will have the following entries referring to these DLLs packaged in .cab files: :

[Add.Code] SIMPLE.OCX=SIMPLE.OCX ASYCFILT.DLL=ASYCFILT.DLL MSVBVM50.DLL=MSVBVM50.DLL



[ASYCFILT.DLL] hook=AsycFilt.cab_Installer FileVersion=2,20,4056,1 [AsycFilt.cab_Installer] file-win32-x86=http://activex.microsoft.com/controls/vb5/AsycFilt.cab InfFile=AsycFilt.inf [MSVBVM50.DLL] hook=MSVBVM50.cab_Installer FileVersion=5,0,37,24 [MSVBVM50.cab_Installer] file-win32-x86=http://activex.microsoft.com/controls/vb5/MSVBVM50.cab InfFile=MSVBVM50.inf In some cases, a dependent DLL may be registered correctly in the client machine but no longer exist in the directory specified in the registry. This occasionally happens when a user unknowingly moves the DLL to another location or deletes the file from the machine and forgets to update the registry entries appropriately.

The easiest way to work around this problem is to run the Registry Editor, Regedit.exe, and search on the dependent DLLs name to find out the expected location of the missing dependent DLL. If the file no longer exists in that directory, manually copy the DLL into that location. Restart Internet Explorer and navigate to the page containing the ActiveX control and see if it displays correctly.

WARNING: Using Registry Editor incorrectly can cause serious, system- wide problems that may require you to reinstall Windows to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.

Missing .lpk File when Using a Licensed ActiveX Control
A common symptom of this problem is that the ActiveX control displays correctly in the development machine, but not on others.

To use licensed controls in an HTML page on a non-licensed computer, you must generate a license package file (.lpk) and insert an  tag for the License Manager object before the actual  tag for the ActiveX controls.

For additional information, please see the following article in the Microsoft Knowledge Base: "Q159923 HOWTO: Using Licensed ActiveX Controls in Internet Explorer"

ActiveX Control Contains Other Licensed Controls Requiring Run-Time License
An example of this is an ActiveX control that contains the Visual Basic 4.0 version of the Mscomm32.ocx, which is a licensed control. The ActiveX control displays correctly on any machine that that Visual Basic or Visual C++ installed because VB and VC++ provide run-time licenses for these controls automatically when installed.

To work around this problem, find a non-licensed version of the same control, or another third-party control with the same functionality. In the case of the licensed Mscomm32.ocx, the version of Mscomm32.ocx that was distributed with Visual Basic 5.0 is not licensed and can be used. This control may be downloaded directly from [http://activex.microsoft.com/controls/vb5/mscomm32.cab. http://activex.microsoft.com/controls/vb5/mscomm32.cab].

Missing CODEBASE Attribute in the ActiveX Control's  Tag
A machine that does not have the ActiveX control already installed will not be able to download the control without a CODEBASE specified in the  tag, and consequently will not be able to display the control.

Always specify a CODEBASE attribute in the control's  tag, pointing to the correct download location for the control.

For example, when inserting an HTML Layout Control in your HTML page, be sure to set the Codebase attribute on the Object tag for the HTML Layout Control as follows:   