K
kai14
Hi! Need some help here, I've been working on this for days and the ActiveX
pop up is still appearing in IE..
I'm trying to implement IObjectSafety so I followed the steps in this link(
http://support.microsoft.com/kb/182598) also tried to simplify the code into:
bas file:
<Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064"), _
ComImport(), _
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IObjectSafety
<PreserveSig()> _
Function GetInterfaceSafetyOptions(ByRef riid As Guid, _
<MarshalAs(UnmanagedType.U4)> ByRef pdwSupportedOptions As Integer, _
<MarshalAs(UnmanagedType.U4)> ByRef pdwEnabledOptions As Integer) As
Integer
<PreserveSig()> _
Function SetInterfaceSafetyOptions(ByRef riid As Guid, _
<MarshalAs(UnmanagedType.U4)> ByVal dwOptionSetMask As Integer, _
<MarshalAs(UnmanagedType.U4)> ByVal dwEnabledOptions As Integer) As
Integer
End Interface
Public Const IID_IDispatch = "{00020400-0000-0000-C000-000000000046}"
Public Const IID_IPersistStorage = "{0000010A-0000-0000-C000-000000000046}
"
Public Const IID_IPersistStream = "{00000109-0000-0000-C000-000000000046}
"
Public Const IID_IPersistPropertyBag = "{37D84F60-42CB-11CE-8135-
00AA004BB851}"
Public Const INTERFACESAFE_FOR_UNTRUSTED_CALLER = &H1
Public Const INTERFACESAFE_FOR_UNTRUSTED_DATA = &H2
Public m_fSafeForScripting As Boolean
Public m_fSafeForInitializing As Boolean
Public Sub New()
MyBase.New()
m_fSafeForScripting = True
m_fSafeForInitializing = True
End Sub
ctl file:
Option Explict
Implements IObjectSafety
Public Function GetInterfaceSafetyOptions(ByRef riid As System.Guid,
ByRef pdwSupportedOptions As Integer, ByRef pdwEnabledOptions As Integer) As
Integer Implements IObjectSafety.GetInterfaceSafetyOptions
Dim strGUID As String = riid.ToString("B")
pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER Or _
INTERFACESAFE_FOR_UNTRUSTED_DATA
pdwEnabledOptions = pdwSupportedOptions
End Function
Public Function SetInterfaceSafetyOptions(ByRef riid As System.Guid,
ByVal dwOptionSetMask As Integer, ByVal dwEnabledOptions As Integer) As
Integer Implements
End Function
Start up object is pointing to Sub Main and when I created the cab file, the
control was set as safe for scripting and initialization.
Thanks in advance!
pop up is still appearing in IE..
I'm trying to implement IObjectSafety so I followed the steps in this link(
http://support.microsoft.com/kb/182598) also tried to simplify the code into:
bas file:
<Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064"), _
ComImport(), _
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IObjectSafety
<PreserveSig()> _
Function GetInterfaceSafetyOptions(ByRef riid As Guid, _
<MarshalAs(UnmanagedType.U4)> ByRef pdwSupportedOptions As Integer, _
<MarshalAs(UnmanagedType.U4)> ByRef pdwEnabledOptions As Integer) As
Integer
<PreserveSig()> _
Function SetInterfaceSafetyOptions(ByRef riid As Guid, _
<MarshalAs(UnmanagedType.U4)> ByVal dwOptionSetMask As Integer, _
<MarshalAs(UnmanagedType.U4)> ByVal dwEnabledOptions As Integer) As
Integer
End Interface
Public Const IID_IDispatch = "{00020400-0000-0000-C000-000000000046}"
Public Const IID_IPersistStorage = "{0000010A-0000-0000-C000-000000000046}
"
Public Const IID_IPersistStream = "{00000109-0000-0000-C000-000000000046}
"
Public Const IID_IPersistPropertyBag = "{37D84F60-42CB-11CE-8135-
00AA004BB851}"
Public Const INTERFACESAFE_FOR_UNTRUSTED_CALLER = &H1
Public Const INTERFACESAFE_FOR_UNTRUSTED_DATA = &H2
Public m_fSafeForScripting As Boolean
Public m_fSafeForInitializing As Boolean
Public Sub New()
MyBase.New()
m_fSafeForScripting = True
m_fSafeForInitializing = True
End Sub
ctl file:
Option Explict
Implements IObjectSafety
Public Function GetInterfaceSafetyOptions(ByRef riid As System.Guid,
ByRef pdwSupportedOptions As Integer, ByRef pdwEnabledOptions As Integer) As
Integer Implements IObjectSafety.GetInterfaceSafetyOptions
Dim strGUID As String = riid.ToString("B")
pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER Or _
INTERFACESAFE_FOR_UNTRUSTED_DATA
pdwEnabledOptions = pdwSupportedOptions
End Function
Public Function SetInterfaceSafetyOptions(ByRef riid As System.Guid,
ByVal dwOptionSetMask As Integer, ByVal dwEnabledOptions As Integer) As
Integer Implements
End Function
Start up object is pointing to Sub Main and when I created the cab file, the
control was set as safe for scripting and initialization.
Thanks in advance!