How to mark MFC ActiveX controls as Safe for Scripting and Initialization (161873)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Internet Client SDK 4.0
- Microsoft Internet Client SDK 4.01
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
This article was previously published under Q161873 SUMMARY
By default, MFC ActiveX controls are not marked as Safe for Scripting
and Safe for Initialization. This becomes apparent when the control is
run in the Internet Explorer with the security level set to medium or high.
In either of these modes, warnings may be displayed that the control's data
is not safe or that the control may not be safe for scripts to use.
There are two methods that a control can use to eliminate these errors. The
first involves the control implementing the IObjectSafety interface and is
useful for controls that would like to change their behavior and become
"safe" if run in the context of an Internet Browser. The second involves
modifying the control's DllRegisterServer function to mark the control
"safe" in the registry. This article covers the second of these methods.
The first method, implementing the IObjectSafety interface, is covered in
the Internet Client SDK.
Please keep in mind that a control should only be marked as safe if it is,
in fact, safe. Please refer to the Internet Client SDK documentation for a
description of this. See "Safe Initialization and Scripting for ActiveX
Controls" under the Component Development Section.
Note This article does not cover how to mark a control safe for
downloading. For more information on code download and code signing, please
refer to the Internet Client SDK.
REFERENCES
Internet Client SDK - Component Development - Safe Initialization and
Scripting for ActiveX Controls
Modification Type: | Major | Last Reviewed: | 9/1/2005 |
---|
Keywords: | kbMFC kbCtrl kbhowto kbInprocSvr KB161873 kbAudDeveloper |
---|
|