为什么实现IObjectSafety不起作用? [英] Why doesn't implementing IObjectSafety make a difference?

查看:91
本文介绍了为什么实现IObjectSafety不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个实现IObjectSafety的activex对象,以表明它可以安全地进行脚本编写。它从受信任的站点安装。但是我们仍然收到IE的抱怨,即此页面上的控件不能安全地编写脚本。

we have an activex object which implements IObjectSafety to indicate that it is safe for scripting. It installs from a trusted site. but we still get the IE complaint that the control on this page is not safe for scripting.

运行ActiveX的网站管理员不愿意启用控件

The admins for the site that are running our activex are reluctant to enable controls not marked safe for scripting even though its the trusted zone.

我们的出租车及其所有组件均已签名(我们最终通过签名进入的每个dll,使通用发行商消失了)。 msi安装程序)

our cab and all its components are signed (we finally made the uverified publisher go away by signing every dll that went into the msi installer)

有人对如何使IObjectSafety正常工作有任何想法吗?

anybody have any thoughts on how to bludgeon IObjectSafety into working?

推荐答案

确保为IObjectSafety使用正确的GUID。界面应如下所示,并带有特定的GUID:

Make sure that you are using the correct GUID for IObjectSafety. Your interface should look like this, with the specific GUID:

[ComImport]
// This GUID matters!
[Guid("CB5BDC81-93C1-11CF-8F20-00805F2CD064")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IObjectSafety
{
    [PreserveSig]
    int GetInterfaceSafetyOptions(ref Guid riid, out int pdwSupportedOptions, out int pdwEnabledOptions);

    [PreserveSig]
    int SetInterfaceSafetyOptions(ref Guid riid, int dwOptionsMask, int dwEnabledOptions);
}

这里有一些链接概述了如何实现 IObjectSafety ,但这是我发现的唯一一个指出了Guid很重要的事实。在我的代码中进行了更改之后,IE不再抱怨。

There are a few links out there that outline how to implement IObjectSafety, but here's the only one I found that calls out the fact that the Guid matters. After making that change in my code, IE no longer complained.

这篇关于为什么实现IObjectSafety不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆