Registering C++ DLL on 64-bit machine

2.6k views Asked by At

I have a C++ DLL that I wrote that is failing to register on a 64-bit machine. Note the 32-bit version of the DLL registers on a 32-bit machine.

We build the DLL on a 64-bit Windows 7 computer using Visual Studio 2010 in Release mode and target the x64 platform. I want to install the DLL on a 64-bit Windows 10 computer (destination). The destination computer has the VS 2010 redist installed for 64-bit. When I try to register the program using:

C:\windows\system32\regsvr32.exe

It fails and says that the program "may not be compatible with this version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe".

I use the program called Dependencies that tries to figure out what dependencies the DLL requires. Dependencies says that my DLL requires ATL100.dll. However, this is installed by the VS 2010 redist and is indeed located in C:\windows\system32. The DLL itself does not depend on any third-party programs.

Does anyone have any ideas to what to look for next to get this file registered?

1

There are 1 answers

0
TylerE On BEST ANSWER

I figured it out. I had to uninstall the 64-bit and 32-bit VS 2010 redist . Delete the ATL100.dll out of the C:\windows\system32 and syswow64 directories and reboot the computer. After the reboot I reinstalled both redist installers. Then I was able to register the file from an administrative command prompt.

Maybe something we installed installed the ATL100.dll file and when I installed the 64-bit redist it did not overwrite the ATL100.dll. Leaving a outdated version installed.