0
votes

My program dynamically loads a number of DLL's using LoadLibrary and (on literally all machines) these load successfully, on one machine some of these DLL's do not get loaded. I added code to trace lasterror and this reports "0x43 The network name cannot be found.".

The machine in question is running Windows 7 Enterprise x64, the DLL is a 32 bit DLL, this shouldn't be an issue and (in fact) this is my development environment.

I also tried converting the name of the DLL (which includes the path) to a short filename and used that in the call to LoadLibrary, I still got the same error.

Any ideas?

//*eggbox

2
LoadLibrary has a complicated search path algorithm, could an invalid network path have ended up on the search path?Benj
The filename provided to LoadLibrary is fully qualified, e.g. C:\Program Files (x86)\MyApp\DLLs\AssetModule.dll, or the short name version.eggbox
Sure, but what about libraries which it depends upon?Benj
Good point, the answer below gives me a clue as to what I can use.eggbox

2 Answers

2
votes

Download Procmon let it run and filter for you dll name. This will immediately give you the locations where the dll was searched and which access path did return 0x43.

You get even the call stacks if you have the pdbs for your code as well (C/C++ only no managed code).

0
votes

Run the program through Dependency Walker in its Profile mode and let that fine tool tell you exactly what is going wrong.