How do I install both 32-bit and 64-bit versions of a COM DLL and “auto-select”?

后端 未结 2 1861
清歌不尽
清歌不尽 2021-01-02 17:07

We\'ve got a DLL (a COM server) that will compile fine in 32-bit and 64-bit, but the DLL uses the same CLSID and AppID for the 32-bit version and the 64-bit version. Is this

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-02 17:17

    Both versions can (and indeed should) use the same GUIDs for everything.

    On a 32-bit machine you can't register or use the 64-bit DLL, so there's no problem there. The 64-bit DLL simply doesn't enter the picture.

    On a 64-bit machine the 64-bit DLL gets registered in HKLM/Software/Classes/CLSID (etc.) and the 32-bit DLL gets registered in HKLM/Software/Wow6432Node/Classes/CLSID. (I wonder where you got the advice that you can't register the 32-bit DLL on a 64-bit machine...) A 32-bit client running on the 64-bit machine will look in the normal place in the registry, but the OS will silently redirect it to the Wow6432Node key instead.

提交回复
热议问题