I misunderstood the dependency issue. In general, I prefer to provide explicit paths to loadlibrary to avoid any confusion where the dll is being loaded from.

To solve your problem, retrieve the path of the app as I mentioned before, then call SetWorkingDirectory. Finally call load library.