How to make LoadLibrary to show error dialog when there are missing dependencies
问题 Suppose we have two dynamic libraries libfoo.dll and libbar.dll , given that libbar.dll depends on libfoo.dll . Further we compile an executable test.exe that loads our libbar.dll using WinAPI function LoadLibrary() . If we run text.exe on Windows XP with missing libfoo.dll , LoadLibrary() shows dialog box alerting than libfoo.dll is actually missing and sets LastError to ERROR_MOD_NOT_FOUND (126). If we run same text.exe in same conditions on Windows 10, LoadLibrary() sets LastError to ERROR