473,769 Members | 6,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

An ActiveX control might be unsafe to interact with other parts of the page. Do you want to allow this interaction?

I have an ActiveX control in my web page that I tried to access using
intranet.
I have implemented IObjectSafety in the ActiveX control, and when I created
the CAB file using VB Pakage and Deployment Wizard, under "Safety Settings"
I selected "Yes" for "Safe for Scripting" and "Yes" for "Safe for
Initialization" . I also have signed the CAB file.
In IE, the option 'Script ActiveX controls marked Safe for Scripting' is
already set to 'Enable' (I use Security setting "Medium-Low").

I get a warning message 'An ActiveX control might be unsafe to interact with
other parts of the page. Do you want to allow this interaction?'

Why do I still get the prompt when I go to the web page ?

Thank you very much.
Nov 25 '05 #1
4 23370
"fniles" <fn****@pfmail. com> wrote in message
news:en******** ******@tk2msftn gp13.phx.gbl
I have an ActiveX control in my web page that I tried to access using
intranet.
I have implemented IObjectSafety in the ActiveX control, and when I
created the CAB file using VB Pakage and Deployment Wizard, under
"Safety Settings" I selected "Yes" for "Safe for Scripting" and "Yes"
for "Safe for Initialization" . I also have signed the CAB file.
In IE, the option 'Script ActiveX controls marked Safe for Scripting'
is already set to 'Enable' (I use Security setting "Medium-Low").

I get a warning message 'An ActiveX control might be unsafe to
interact with other parts of the page. Do you want to allow this
interaction?'


Show how you implement IObjectSafety. It looks like you do it
incorrectly.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Nov 25 '05 #2
On the ActiveX control Project menu, click References, and added VB
IObjectSafety Interface (c:\windows\sys tem32\Objsafe.t lb) -> I did not
create this .tlb file myself, it's already there in c:\windows\syst em32.

In the ActiveX control project, I have a module called basSafectl.bas:
Option Explicit

Public Const IID_IDispatch = "{00020400-0000-0000-C000-000000000046}"
Public Const IID_IPersistSto rage =
"{0000010A-0000-0000-C000-000000000046}"
Public Const IID_IPersistStr eam =
"{00000109-0000-0000-C000-000000000046}"
Public Const IID_IPersistPro pertyBag =
"{37D84F60-42CB-11CE-8135-00AA004BB851}"

Public Const INTERFACESAFE_F OR_UNTRUSTED_CA LLER = &H1
Public Const INTERFACESAFE_F OR_UNTRUSTED_DA TA = &H2
Public Const E_NOINTERFACE = &H80004002
Public Const E_FAIL = &H80004005
Public Const MAX_GUIDLEN = 40

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMem ory" _
(pDest As Any, pSource As Any, ByVal ByteLen As Long)
Public Declare Function StringFromGUID2 Lib "ole32.dll" (rguid As _
Any, ByVal lpstrClsId As Long, ByVal cbMax As Integer) As Long

Public Type udtGUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type

Public m_fSafeForScrip ting As Boolean
Public m_fSafeForIniti alizing As Boolean

Sub Main()
m_fSafeForScrip ting = True
m_fSafeForIniti alizing = True
End Sub

In the ActiveX control project, in the control:
Option Explicit
Implements IObjectSafety

Private Sub IObjectSafety_G etInterfaceSafe tyOptions(ByVal riid As _
Long, pdwSupportedOpt ions As Long, pdwEnabledOptio ns As Long)

Dim rc As Long
Dim rClsId As udtGUID
Dim IID As String
Dim bIID() As Byte

pdwSupportedOpt ions = INTERFACESAFE_F OR_UNTRUSTED_CA LLER Or _
INTERFACESAFE_F OR_UNTRUSTED_DA TA

If (riid <> 0) Then
CopyMemory rClsId, ByVal riid, Len(rClsId)

bIID = String$(MAX_GUI DLEN, 0)
rc = StringFromGUID2 (rClsId, VarPtr(bIID(0)) , MAX_GUIDLEN)
rc = InStr(1, bIID, vbNullChar) - 1
IID = Left$(UCase(bII D), rc)

Select Case IID
Case IID_IDispatch
pdwEnabledOptio ns = IIf(m_fSafeForS cripting, _
INTERFACESAFE_F OR_UNTRUSTED_CA LLER, 0)
Exit Sub
Case IID_IPersistSto rage, IID_IPersistStr eam, _
IID_IPersistPro pertyBag
pdwEnabledOptio ns = IIf(m_fSafeForI nitializing, _
INTERFACESAFE_F OR_UNTRUSTED_DA TA, 0)
Exit Sub
Case Else
Err.Raise E_NOINTERFACE
Exit Sub
End Select
End If
End Sub

Private Sub IObjectSafety_S etInterfaceSafe tyOptions(ByVal riid As _
Long, ByVal dwOptionsSetMas k As Long, ByVal dwEnabledOption s As Long)
Dim rc As Long
Dim rClsId As udtGUID
Dim IID As String
Dim bIID() As Byte

If (riid <> 0) Then
CopyMemory rClsId, ByVal riid, Len(rClsId)

bIID = String$(MAX_GUI DLEN, 0)
rc = StringFromGUID2 (rClsId, VarPtr(bIID(0)) , MAX_GUIDLEN)
rc = InStr(1, bIID, vbNullChar) - 1
IID = Left$(UCase(bII D), rc)

Select Case IID
Case IID_IDispatch
If ((dwEnabledOpti ons And dwOptionsSetMas k) <> _
INTERFACESAFE_F OR_UNTRUSTED_CA LLER) Then
Err.Raise E_FAIL
Exit Sub
Else
If Not m_fSafeForScrip ting Then
Err.Raise E_FAIL
End If
Exit Sub
End If

Case IID_IPersistSto rage, IID_IPersistStr eam, _
IID_IPersistPro pertyBag
If ((dwEnabledOpti ons And dwOptionsSetMas k) <> _
INTERFACESAFE_F OR_UNTRUSTED_DA TA) Then
Err.Raise E_FAIL
Exit Sub
Else
If Not m_fSafeForIniti alizing Then
Err.Raise E_FAIL
End If
Exit Sub
End If

Case Else
Err.Raise E_NOINTERFACE
Exit Sub
End Select
End If
End Sub

Thank you.

"Igor Tandetnik" <it********@mvp s.org> wrote in message
news:u4******** ******@TK2MSFTN GP09.phx.gbl...
"fniles" <fn****@pfmail. com> wrote in message
news:en******** ******@tk2msftn gp13.phx.gbl
I have an ActiveX control in my web page that I tried to access using
intranet.
I have implemented IObjectSafety in the ActiveX control, and when I
created the CAB file using VB Pakage and Deployment Wizard, under
"Safety Settings" I selected "Yes" for "Safe for Scripting" and "Yes"
for "Safe for Initialization" . I also have signed the CAB file.
In IE, the option 'Script ActiveX controls marked Safe for Scripting'
is already set to 'Enable' (I use Security setting "Medium-Low").

I get a warning message 'An ActiveX control might be unsafe to
interact with other parts of the page. Do you want to allow this
interaction?'


Show how you implement IObjectSafety. It looks like you do it incorrectly.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925

Nov 25 '05 #3
"fniles" <fn****@pfmail. com> wrote in message
news:eG******** *****@TK2MSFTNG P10.phx.gbl
In the ActiveX control project, I have a module called basSafectl.bas:
Option Explicit


I don't really know VB so I cannot intelligently comment on this code.
Just make sure that pdwEnabledOptio ns does indeed end up with
INTERFACESAFE_F OR_UNTRUSTED_CA LLER flag in it. If I were you, I'd just
throw in both INTERFACESAFE_F OR_UNTRUSTED_CA LLER and
INTERFACESAFE_F OR_UNTRUSTED_DA TA unconditionally . It is very unusual to
have to vary your flags depending on the IID parameter.
SetInterfaceSaf etyOptions is also only needed in rare advanced cases -
most of the time you just return S_OK and do nothing.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Nov 25 '05 #4
Thanks for your help.
I found my problem.
From Project Properties, I need to change the Startup Object to Sub Main to
execute the Sub Main.

Sub Main()
m_fSafeForScrip ting = True
m_fSafeForIniti alizing = True
End Sub
"Igor Tandetnik" <it********@mvp s.org> wrote in message
news:eR******** ******@TK2MSFTN GP10.phx.gbl...
"fniles" <fn****@pfmail. com> wrote in message
news:eG******** *****@TK2MSFTNG P10.phx.gbl
In the ActiveX control project, I have a module called basSafectl.bas:
Option Explicit


I don't really know VB so I cannot intelligently comment on this code.
Just make sure that pdwEnabledOptio ns does indeed end up with
INTERFACESAFE_F OR_UNTRUSTED_CA LLER flag in it. If I were you, I'd just
throw in both INTERFACESAFE_F OR_UNTRUSTED_CA LLER and
INTERFACESAFE_F OR_UNTRUSTED_DA TA unconditionally . It is very unusual to
have to vary your flags depending on the IID parameter.
SetInterfaceSaf etyOptions is also only needed in rare advanced cases -
most of the time you just return S_OK and do nothing.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925

Nov 29 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
14467
by: Steven Kobes | last post by:
I have an HTML file containing some JScript that creates a "WScript.Shell" ActiveX object. When it loads, Internet Explorer says: "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?" I would like to suppress this message, but even when I set all ActiveX-related security settings to "Enable", it still appears.
11
3648
by: Dave | last post by:
I have this sample HTML code: <html> <head> <script type="text/javascript"> var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); </script> </head>
1
1768
by: Anand Kale | last post by:
How to have ActiveX control called from Web Form in ASP.Net ? ActiveX control is written using VC++/MFC/ATL-COM. Also kindly answer following issues, 1. Also how to take care of issues about security etc ? 2. Can anyone give me exact steps to embedd activex in a web form ? 3. Can the activeX control interact with the server side control on the web form ? 4. Do I need to register the activeX on client machine ? I want to download the...
1
2258
by: fniles | last post by:
I have an ActiveX control in my ASP page that has not been signed yet, so currently just for testing I set the Security for Intranet to "Low". When I run the ASP page on my machine (the IIS is in my machine), I have no problem, except the page prompted me with "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?" But, when I run the ASP page on another machine...
2
2828
by: =?Utf-8?B?Sm9obiBG?= | last post by:
Hello All, I have a question about using an ActiveX control with a Windows Servce in C#. I believe it is not possible to properly setup an ActiveX control in a windows service as the particular ActiveX control we're using (GrFinger for fingerprint reader)implements several event handlers. It is also my understanding that there is no Message Pump within a Windows Service. I suppose I could create my own message pump, but this seems...
4
2436
by: Mr Seth T | last post by:
Hey, I have spent several days trying to find out how to do something, and i don't know if I am blind or what, but I can not find it. I am developing a web app and I need it to run an activex control. I have developed the control and it runs great on my development system (VS2005, C#, IE6, Win2000Pro, output is a DLL) because as far as I can tell, the IDE registers the DLL. The problem is packaging it so it registers itself on any...
2
2686
by: PriyaPadma | last post by:
Hi All, Help Need. We are using third party control. We didnt receieve any codebehind and dll. Basically website developed in AJAX. Here is my problem. I need to populate windows login username in a textbox. So I used javascript to populate windows login. But I am getting "ActiveX control control on this page might be unsage to interact with other parts of the page" How to avoid this alert message. Pls help me ASAP!
8
17250
by: sebouh181 | last post by:
I am writing to registry using javascript. var wsh = new ActiveXObject("WScript.Shell"); var key = "HKLM\\Software\\Neos\\2.0\\LightMode\\my-script"; wsh.RegWrite (key, 1999, "REG_SZ"); when i run this javascript code in my HTML page the following warning message appears An ActiveX control might be unsafe to interact with other parts of the page. Do you want to allow this interaction? I want to remove this message.
0
2399
by: frkem | last post by:
After virus infection (Sohanad 32) an I deleted all infected files my windows operating system is not working. Windows media player, search, help and support icon by double clicking it one message appear an activex control might be unsafe to interact other part of the page.
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.