.net com注册后 IE中创建automation自动化对象失败:新版IE 64位与32位

前言:为了方便其它语文调用,使用.net注册了一个com组件。测试时,使用VB测试成功,但是在IE中一直失败。

期间也检查过32位与64位版本问题,通过任务管理器,看到IE名称的后边没有跟“32位”的标识,所以就认定为IE进程是64位的。没想到每个tab进程默认是32位的。

知道了原因,问题也就好解决了:再使用32位的RegAsm注册一下就成功了!

特别备注一下,使用OLEView可以查看注册的com是32位和/或是64位的。

下边引入原文:

How to enable 64-bit Internet Explorer processes

RECOMMENDED: Click here to fix Windows errors and optimize system performance

As you may be knowing, 64-bit editions of Windows include 32-bit Internet Explorer as well as a 64-bit version. This has been the case since Windows XP Professional x64 Edition and the reason that both editions are included is for compatibility with addons. When 64-bit IE was first introduced, most addons like Flash Player, Java, and most ActiveX controls were 32-bit only. 32-bit addons cannot work with 64-bit IE, that’s why Microsoft bundled both x86 and x64 IE versions. Users could easily open whichever IE they wanted but this changed with Internet Explorer 10. Let us see how.

The first 64-bit version of IE was Internet Explorer 6, included in the 64-bit edition of Windows XP. From IE6 all the way till IE9, you could open 32-bit IE from C:\Program Files (x86)\Internet Explorer\IExplore.exe and 64-bit IE from C:\Program Files\Internet Explorer\IExplore.exe. In the Task Manager of 64-bit Windows, you can see which IE processes are 32-bit from the Processes tab.

However in Internet Explorer 10, Microsoft made a change – the browser frame process is always 64-bit in IE10 and above but the tab processes are 32-bit by default. Regardless of whether you open IE from Program Files or Program Files (x86), this is the case.

IE10 introduced a new feature called Enhanced Protected Mode. If Enhanced Protected Mode is enabled, then IE enables 64-bit tab processes. Conversely, to enable 64-bit IE, you must go to Internet Options -> Advanced tab and check the option “Enable Enhanced Protected Mode” under the Security section. Thereafter, you must close all IE processes and restart the browser to make all processes 64-bit.

Internet Explorer 11 made another change on 64-bit Windows 8.1. It has two separate options now on the Advanced tab – “Enable Enhanced Protected Mode” and “Enable 64-bit processes for Enhanced Protected Mode”. But only enabling “Enable 64-bit processes for Enhanced Protected Mode” seems to turn on 64-bit processes. You don’t need to check “Enable Enhanced Protected Mode” like you had to for IE10 to get 64-bit processes.

64-bit-IE

On Windows 7 with IE11, it’s a different story – there is still a single option like IE10 because the AppContainer Integrity Level for sandboxing is not available on Windows 7. Only on Windows 8.1 with IE11, there are 2 separate options.

Before you enable 64-bit IE, you might want to make sure that all the addons you need are compatible. Go to Internet Explorer Tools menu -> Manage Add-Ons to see if your addons are 32-bit, 64-bit or both. The ‘Architecture’ column shows that as in the picture below:

IE-Addons-600x447
IE’s Manage Addons dialog

发表评论

电子邮件地址不会被公开。