Regsvr32 fails to find the dll in the current folder
Question
When I use "regsvr32 foo.dll" i get a "The specified module cannot be found" error.
The error is being caused because regsvr32 cannot find the file even though it is the current folder.
I have specified the full path, and it still doen't work. Any ideas????
Solution
This can happen if foo.dll
has a depenency on bar.dll
and it's actually bar.dll
that can't be found.
Try using depends.exe
from MSVC to check the dependencies of foo.dll
and see if any are missing.
Another option is to download and run FileMon. Then run regsvr32
again and see which file/module it fails to find. This should definitely track it down.
OTHER TIPS
On the 64bit OSes, Dependency Walker has been uninformative for me; and FileMon
has been replaced by Process Monitor (see https://docs.microsoft.com/en-us/sysinternals/downloads/procmon to download the utility). Here is how I was able to find the missing references using Process Monitor:
Open the Filter Dialog either from the toolbar or the menu.
Add the Process Name
of regsvr32.exe
to the filter list and remove any PID
filters.
Clear the list, ...
... turn on Capturing, if it is not already on.
Run your regsvr32.exe
command from a console window. Once complete, you might want to toggle the capture off.
Look for the missing reference after regsvr32
has loaded your DLL.