Search code examples
c++com64-bit32bit-64bit32-bit

Loading native COM DLLs in 64bit environment


I have a 32bit/64bit COM DLLs in C++: mycom32.dll, mycom64.dll. Both of them are exactly the same but mycom32.dll is compiled for 32bit and mycom64.dll is compiled for 64bit. That means that BOTH DLLs have the same UUID and the same CLSID!

Now, sometimes I want to use this COM from 32bit processes and sometimes I want to use this COM from 64bit processes.

Is it possible to load the correct DLL without creating two different CLSIDs and check during runtime if the process is 32bit/64bit?


Solution

  • It should be possible to register both of them without issue; this is part of what Registry Redirection is supposed to solve.

    Here's a more detailed explanation of how this works.