Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

dll

64-bit

com

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.

like image 633
Kev Avatar asked Jul 09 '09 16:07

Kev


People also ask

Will 32-bit and 64-bit combination compatible and will work together?

The 64-bit versions of Windows don't provide support for 16-bit binaries or 32-bit drivers. Programs that depend on 16-bit binaries or 32-bit drivers can't run on the 64-bit versions of Windows unless the program manufacturer provides an update for the program.

Can I have both 32 and 64-bit Windows?

You can't run it side-by-side. This is an upgrade copy that can only be used in a single instance. You can go to 64-bit if you want, but you have to do it with a clean install following your first 32-bit upgrade.

What happens if you use 32-bit on 64-bit?

Can I run 32-bit programs on a 64-bit computer? Most programs made for the 32-bit version of Windows will work on the 64-bit version of Windows except for most Antivirus programs. Device drivers that are made for the 32-bit version of Windows will not work correctly on a computer running a 64-bit version of Windows.


1 Answers

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.

like image 62
Michael Avatar answered Nov 15 '22 10:11

Michael