Does Windows leave previously loaded DLLs, loaded? One thing I've noticed is that sometimes, if I have a program that loads a DLL with LoadLibrary(), then I recompile the library and overwrite the DLL file, and run the program again, the program crashes from inside the library. Has this happened to anyone else?
What exactly triggers the "This application has failed to start because *.dll was not found." message? I'm building a project by linking everything statically, but some dependency is still trying to link to this DLL, even though at no point was any DLL generated. The strangest thing is that even though the DLL wasn't found, the program still runs.
I was under the impression that when you use an import lib, the name of the corresponding dll is place in the exe file and when windows loads, it checks the exe file, loads any required dlls and makes the dll function
call fixups.
That's how I think it works, too, but here's the thing: the DLL's name doesn't appear anywhere in the .libs (yes, I searched using UCS-2). As far as I can tell, there's no reason for a DLL to be loaded.
Well, the generated .lib was giving me problems when I tried to dynamically link a different library, so since the DLL was going to be loaded anyway, I just built the library for dynamic link. Still, I don't understand how or why it was attempting to link to something it shouldn't know about.