为什么不实现IObjectSafety有所作为 [英] why doesn't implement IObjectSafety make a difference

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

问题描述

我们有一个activex对象,它实现IObjectSafety以指示脚本安全。它从受信任的站点安装。但我们仍然得到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天全站免登陆