简体   繁体   English

window.external在C#App的IE6(Win XP SP3)中不起作用

[英]window.external not working in IE6 (Win XP SP3) from C# App

I've been using window.external in my c# windows application successfully to call a public function in my C# form. 我一直在C#Windows应用程序中成功使用window.external来以C#形式调用公共函数。 I've correctly set the objectforscripting property, and this works wonderfully on my development machine which has Windows 7 and IE9. 我已经正确设置了objectforscripting属性,并且该属性在具有Windows 7和IE9的开发计算机上非常有效。

On my test machine however, which is a windows XP computer, window.external is not working. 但是,在我的测试计算机(是Windows XP计算机)上,window.external无法正常工作。 I am getting 'object' when I check the typeof of the window.external object, but when I try to enumerate it for functions, there's nothing. 当我检查window.external对象的类型时,我得到了“对象”,但是当我尝试对函数进行枚举时,什么也没有。

When I try to call the function nothing happens. 当我尝试调用该函数时,没有任何反应。 There must be a javascript error, but don't know what it is since the browser doesn't tell me. 一定有一个JavaScript错误,但由于浏览器没有告诉我,所以不知道是什么错误。

I am sure windows.external is pretty popular and people must have used it on all OSs including WinXp and IE6. 我确信windows.external非常流行,人们肯定已经在包括WinXp和IE6在内的所有操作系统上使用了它。 Any idea why this is happening to me? 知道为什么我会这样吗?

Okay, I am a bit embarrassed, but I thought I should tell everybody how I solved it instead of deleting the question so that if anyone else's been stupid enough, they'll know. 好的,我有点不好意思,但是我认为我应该告诉大家我是如何解决的,而不是删除问题,以便如果其他人足够愚蠢,他们就会知道。

The function I am referring to had a call to mshtml dll, which was not a part of my setup build sent to win xp. 我所指的功能有一个对mshtml dll的调用,这不是我的安装版本发送给Win XP的一部分。 window.external doesn't execute a function at all if there's an exception in it like this one. 如果其中存在异常,则window.external根本不会执行任何功能。

I could solve it by including mshtml in the setup. 我可以通过在设置中包含mshtml来解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在C#中为Windows 7和Xp Sp3控制Windows防火墙 - Controlling Windows Firewall in C# for Windows 7 and Xp Sp3 C#WebBrowser控件:window.external访问子对象 - C# WebBrowser control: window.external access sub object Windows XP SP3上将旧C ++ / DirectX 7-8代码从一本书更新为C#/ SlimDX或DirectX 9的最佳过程? - Best process on Windows XP SP3 to update old C++/DirectX 7-8 code from a book to C#/SlimDX or DirectX 9? 如何使用 C# 或免费的 XP 工具卸载或删除 Windows XP Sp3 游戏? - How can I uninstall or delete Windows XP Sp3 Games using C# or free XP tools? Windows XP SP3上的wlanAPI - wlanAPI on Windows XP SP3 使用window.external将javascript日期对象传递给C#WebBrowser控件 - Passing javascript Date object to C# WebBrowser control using window.external 从Exchange Server 2010 SP3使用C#从独立MAPI提取邮件 - Fetching mail from Standalone MAPI using C# from Exchange Server 2010 SP3 window.external 有什么用? - What is the use of window.external? SP3似乎无法在C#中获得屏幕尺寸? - SP3 can't seem to get screen size in C#? 有没有办法从 C# WPF 应用程序中刷新 DNS 缓存? (在 XP、Vista、Win7 上) - Is there a way to flush the DNS cache from a C# WPF app? (on XP, Vista, Win7)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM