FIX: Failed to Mark Safe for Scripting Using Visual Basic PDW (221541)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0, when used with:
- the operating system: Microsoft Windows 95
- the operating system: Microsoft Windows 98
- Microsoft Visual Basic Professional Edition for Windows 6.0, when used with:
- the operating system: Microsoft Windows 95
- the operating system: Microsoft Windows 98
- Microsoft Visual Basic Enterprise Edition for Windows 6.0, when used with:
- the operating system: Microsoft Windows 95
- the operating system: Microsoft Windows 98
This article was previously published under Q221541 SYMPTOMS When an ActiveX control is marked as Safe for Scripting and
Safe for Initialization when packaging it using the Package and Deployment
Wizard (PDW), depending on your security settings for unsafe controls, Internet
Explorer may still identify the ActiveX control as unsafe, or it may display an
"Object Required" error. CAUSE The ActiveX control is not marked as Safe for Scripting and
Safe for Initialization in spite of choosing these options when packaging the
control using the Visual Basic 6.0 Package and Deployment Wizard.
This is because the [AddToRegistry] section is missing from the INF file
generated by the Visual Basic 6.0 PDW, and this section usually contains the
registry entries that mark the controls as safe.
RESOLUTION You can manually add the [AddToRegistry] section in your
INF file by following the steps listed below.
- Create your ActiveX Control.
- Package your control using the Package and Deployment
Wizard.
- Before you deploy the package, go to the folder for that
package in Windows Explorer
- There should be a support directory under that package.
Open the Xxx.inf file under this Support directory with Notepad.
- Paste the following code at the end of the file.
[AddToRegistry]
HKLM,"SOFTWARE\Classes\CLSID\{04CD5348-D028-11D2-82A6-00C04FB9D847}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}"
HKLM,"SOFTWARE\Classes\CLSID\{04CD5348-D028-11D2-82A6-00C04FB9D847}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}"
- Save the file with the same name.
- Run the .bat file in the Support folder, which is created
by the PDW. This bat file will re-create your .cab file with the new
changes.
- Now you can use the PDW to deploy the package to the
appropriate Web server location.
The preferred method for marking a control as safe is to
implement the IObjectSafety interface. For information on implementing
theIObjectSafety Interface, please see the following: STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
This
bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio 6.0
Service Packs, please see the following articles in the Microsoft Knowledge
Base: 194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
REFERENCESFor additional information, click the
article numbers below to view the articles in the Microsoft Knowledge Base: 169438 PRB: ActiveX Control Does Not Display Correctly on Web Page
159923 HOWTO: Using Licensed ActiveX Controls in Internet Explorer
172991 INFO: CAB Files Distributed with Visual Basic 5.0
For more
information about developing Web-based solutions for Microsoft Internet
Explorer, visit the following Microsoft Web sites: (c) Microsoft Corporation 1999, All Rights
Reserved. Contributions by Joshua Lee, Microsoft Corporation.
Modification Type: | Major | Last Reviewed: | 9/5/2006 |
---|
Keywords: | kbActiveDocs kbBug kbCtrlCreate kbfix kbSBNWorkshop kbVS600sp3fix KB221541 |
---|
|