Can my 32 bit and 64 bit COM components co-reside on the same machine?

这一生的挚爱 提交于 2019-12-23 11:47:06

问题


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

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).

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?

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


回答1:


This should be possible.

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.

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.

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

And

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

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



来源:https://stackoverflow.com/questions/1105031/can-my-32-bit-and-64-bit-com-components-co-reside-on-the-same-machine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!