Wednesday, March 28, 2007

Fix: Regsvr32 error "The specified module could not be found"

This morning, a tester to whom I had provided a COM .dll file with some extra logging to drop into his installation of one of our products reported to me that he was getting this error when trying to register the .dll on his machine using regsvr32: LoadLibrary([Filename.dll]) failed - The specified module could not be found. I re-checked, and the .dll file I had sent did register properly with regsvr32 on my own machine.

I investigated, and Google Groups helped me find the solution in a microsoft.public.win32.programmer.ole thread. The problem was the .dll file I had built was built in Visual C++ 6 in "debug" mode .dll; the "debug".dll (unbeknownst to me at thetime) had extra .dll dependencies which were present on my machine, but not on the tester's machine.

The solution was to build the .dll in "release" mode instead.

Google also turned up a helpful cryer.co.uk article which lists (1) "The name of the COM object is wrong" and (2) "The COM object requires another library which is missing" as possible causes of the "The specified module could not be found" regsvr32 error. The article suggests using the Sysinternals Filemon utility to determine which .dll file(s) are missing.

1 comment:

  1. Thank you for your guide. I have such a problem with dll files, these files are often in the game folder or its installer (Redist / Vcredist), so I downloaded it http://fix4dll.com/msvcp140_dll and reinstall.

    ReplyDelete