资源管理器栏 - 在第二页(站点)上访问IHTMLWindow2 DOM的安全性错误 [英] Explorer Bar - Security error accessing to IHTMLWindow2 DOM on a second page (site)

查看:111
本文介绍了资源管理器栏 - 在第二页(站点)上访问IHTMLWindow2 DOM的安全性错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用MS CSIEExplorerBa r作为模板编写Explorer Bar。


来自资源管理器Bar我可以访问IHTMLWindow2 DOM,将此引用传递给COM(VB6)组件。


在Windows 7上,当我访问此界面两次时,第二个具有不同的站点(我更改)在地址栏中的网站),我收到以下安全例外:


"应用程序尝试执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或使用Microsoft .NET Framework配置工具。如果单击"继续",应用程序
将忽略此错误并尝试继续。如果单击退出,应用程序将立即关闭"


在Windows XP上它正常工作(没有例外)。


我传递给COM组件使用以下代码:


            mshtml.HTMLDocument doc = explorer.Document as mshtml.HTMLDocument;

            mshtml.IHTMLWindow2 w = doc.parentWindow as mshtml.IHTMLWindow2;

            myComponent.Execute(w);


其中explorer是SHDocVw.InternetExplorer引用。


你能帮助我吗?


谢谢


解决方案

http://www.codeproject.com/Articles/14161/Automation-of-Internet-Explorer-Using-shdocvw- dll


http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/4b8946ac-4d2a-4ac3-99b4-a6335633d4b9/


Hi,

I'm writing an Explorer Bar using MS CSIEExplorerBar as template.

From the Explorer Bar I access to IHTMLWindow2 DOM passing this reference to a COM (VB6) component.

On Windows 7, when I access to this interface twice, the second one with a different site (I change the site in the address bar), I receive the following security exception:

"Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately"

On Windows XP it works right (no exception).

The reference I pass to the COM Component is with this code:

            mshtml.HTMLDocument doc = explorer.Document as mshtml.HTMLDocument;
            mshtml.IHTMLWindow2 w = doc.parentWindow as mshtml.IHTMLWindow2;
            myComponent.Execute(w);

where explorer is the SHDocVw.InternetExplorer reference.

Can you help me ?

Thanks

解决方案

http://www.codeproject.com/Articles/14161/Automation-of-Internet-Explorer-Using-shdocvw-dll

http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/4b8946ac-4d2a-4ac3-99b4-a6335633d4b9/


这篇关于资源管理器栏 - 在第二页(站点)上访问IHTMLWindow2 DOM的安全性错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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