让我的32位和64位COM组件共同驻留在同一台机器上?我的、组件、在同一、机器上

2023-09-08 01:09:30 作者:全国通缉帅哥,我惨了

我有一个是由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位版本在功能上是相同的,它也使用同样的程序id(而据我所知相同的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).

我可以安装/ regsvr 64位版本的同一台机器上的32位版本(显然在不同的文件夹),并有我现有的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语言编写本机code ++组件,而不是.NET。

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

推荐答案

这应该是可能的。

在64位的Windows中,注册表和文件系统被重定向32比特应用。注册为32位COM DLL的将是在注册表(HKLM \ SOFTWARE \ Wow6432Node \类)一个单独的位置,你的COM组件应该生活在不同的文件夹,Program Files下的64位下的程序文件和32位(86)。注册表/文件重定向为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 (HKLM\Software\Wow6432Node\Classes), 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.

有可能的是,组件本身可以prevent此 - 例如,如果它创建全球资源,将卷起的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_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID{8856F961-340A-11D0-A96B-00C04FD705A2}\InProcServer32\Default = C:\ WINDOWS \ SysWow64文件\ ieframe.dll

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID{8856F961-340A-11D0-A96B-00C04FD705A2}\InProcServer32\Default = C:\Windows\SysWow64\ieframe.dll

HKEY_CLASSES_ROOT \ CLSID {8856F961-340A-11D0-A96B-00C04FD705A2} \ InProcServer32中\默认为C:\ WINDOWS \ SYSTEM32 \ ieframe.dll

HKEY_CLASSES_ROOT\CLSID{8856F961-340A-11D0-A96B-00C04FD705A2}\InProcServer32\Default = C:\Windows\System32\ieframe.dll

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

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