我的 32 位和 64 位 COM 组件可以共存于同一台机器上吗? [英] Can my 32 bit and 64 bit COM components co-reside on the same machine?

查看:34
本文介绍了我的 32 位和 64 位 COM 组件可以共存于同一台机器上吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个主要由 ASP 使用的 32 位 COM 组件,我们也有 64 位版本.

I have a 32 bit COM component that is used mostly by ASP, we also have the 64 bit version.

64 位版本在功能上是相同的,它也使用相同的 ProgID(据我所知使用相同的 CLSID 等).

The 64 bit version is functionally identical and it also uses the same ProgID (and as far as I know the same CLSID's etc).

我是否可以在与 32 位版本相同的机器上安装/regsvr 64 位版本(显然在不同的文件夹中)并让我现有的 32 位应用程序继续使用 32 位组件,而我的 64 位应用程序使用64位版本?

Can I install/regsvr the 64 bit version on the same machine as the 32 bit version (obviously in a different folder) and have my existing 32 bit applications continue to use the 32 bit component, whilst my 64 bit applications consume the 64 bit version?

这些是用 C++ 而非 .NET 编写的本机代码组件.

These are native code components written in C++ and not .NET.

推荐答案

这应该是可能的.

在 64 位 Windows 上,注册表文件系统 被重定向到 32 位应用程序.32 位 COM dll 的注册将位于注册表中的单独位置 (HKLMSoftwareWow6432NodeClasses),并且您的 COM 组件应位于单独的文件夹中,64 位位于 Program Files 下,32 位位于 Program Files 下(x86).32 位应用程序的注册表/文件重定向应该使这项工作透明化.

On 64-bit windows, the registry and file system is redirected for 32-bit applications. Registration for the 32-bit COM dll's will be under a separate location in the registry (HKLMSoftwareWow6432NodeClasses), and your COM components should live in separate folders, 64-bit under Program Files and 32-bit under Program Files (x86). The registry/file redirection for 32-bit apps should make this work transparently.

组件本身可能会阻止这种情况发生 - 例如,如果它创建的全局资源最终会在 32 位和 64 位版本之间发生冲突.

It is possible that the component itself could prevent this - for instance, if it creates global resources that would wind up conflicting between the 32-bit and 64-bit versions.

这种情况在 64 位 Windows 上已经存在.在我的 64 位系统上,我有:

This situation already exists on 64-bit Windows. On my 64-bit system I have:

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{8856F961-340A-11D0-A96B-00C04FD705A2}InProcServer32Default = C:WindowsSysWow64ieframe.dll

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{8856F961-340A-11D0-A96B-00C04FD705A2}InProcServer32Default = C:WindowsSysWow64ieframe.dll

HKEY_CLASSES_ROOTCLSID{8856F961-340A-11D0-A96B-00C04FD705A2}InProcServer32Default = C:WindowsSystem32ieframe.dll

HKEY_CLASSES_ROOTCLSID{8856F961-340A-11D0-A96B-00C04FD705A2}InProcServer32Default = C:WindowsSystem32ieframe.dll

同一系统上的 WebBrowser 控件的 32 位和 64 位版本.

32-bit and 64-bit version of WebBrowser control on the same system.

这篇关于我的 32 位和 64 位 COM 组件可以共存于同一台机器上吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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