What happens when I load some dll at run-time (let's call it Lib1.dll) but Lib1.dll also depends on Lib2.dll but Lib2.dll is not there?
+3
A:
If there is a missing dependency, the program won't run: an exception/error will be thrown when an access to the DLL is attempted.
jldupont
2010-01-20 19:26:26
A:
you will get a I/O error when it tries to use something from that dll. it will say it cant load it
AutomatedTester
2010-01-20 19:27:24
The error/exception happens immediately at load time of the DLL, not when it is used.
gwell
2010-01-20 19:54:56
depends how its been used. If you do lazy loading it may load and use at the same time
AutomatedTester
2010-01-20 20:00:30
+2
A:
It depends (sorry). If the DLL in question is statically linked to the missing DLL, then the LoadLibrary call will fail with error 126 (ERROR_MOD_NOT_FOUND). If, however, the DLL attempts to load the missing DLL dynamically (e.g., with LoadLibrary), then the original LoadLibrary call may succeed. The behavior may also change for delay loaded libraries.
Mark Wilkins
2010-01-20 19:45:29