Problem with Regsvr32
I have a project which on successful building provides an abc.dll as an output which is then registered using regsvr32.
I built my Project in the Release configuration. The project builds successfully and then I can successfully register it using regsvr32.
Now I build the same project on VS2008 with the Debug configuration with absolutely no changes to the code. The project builds successfully. However, regsvr32 fails to register and shows a message “Load Library (abc.dll) failed. The specified module could not be found”.
I checked the .wll file with the software called “Dependency Walker”, which provided with a list of dlls that it uses. These are:
I copied all these dlls from C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\dll\x86 and other folders on the system, and downloaded msjava.dll and coredll.dll are downloaded from an external website. And pasted all of them into the C:\Windows\system32 folder.
After this, when I try to register the abc.dll, regsvr32 simply fails – no message at all. When I try to unregister the dll with regsvr32 /u abc.dll, it does not give any response. Any clues?
I have not used the /s option so the suppressing of the message is not the issue.
I suggest you undo those changes you made. Try registering other libraries - does it work? If not, then repair your filesystem. Do not go about replacing or putting stuff into your system folder unless you know what you are doing.
Read the error message clearly, too. It says it cannot find the library, ie cannot find the file it is supposed to register. NOT that it fails in some unknown spectacular way!
Okay you're half way there, you've got the Depends tool. What you need now is the expert tip for how to diagnose this problem:
- Launch Depends
- File -> Open -> Browse to and open regsvr32.exe
- Profile -> Start Proifiling...
- Program Arguments: "C:\MyPath\MyProblematicDLL.dll"
- Check "Use full paths when loging file names" (I remember this helping once)
- Click OK and watch what happens as Regsvr32 tries to register your DLL.
- After its attempt, the tree and list views on the main window should hopefully be updated to show what was the real problem. Don't forget that you can ignore delay loaded DLLs
See many people know to use depends and they know how to register a DLL, but not many know about the profiling feature, or they don't think to combine this with the registering of the DLL.
Thanks a lot for the reply it was really helpful and helped us to push further, i knwo adding dlls from an external source might not be a great idea but then all i was doing was experimenting with a virtual PC so I didnt bother about crashng the system. ANyways thanks again.