Page 1 of 1

Plugin DLL loader does not try the mq2 folder for dependent dll's

Posted: Fri Mar 01, 2019 3:10 am
by silverj
Failing to load plugins that would use dll dependencies. When this is fixed, plugins could use standard shared libraries to optimize size or whatever. I am writing a plugin to allow writing lua scripts instead of the mq2 custom scripting language, and that plugin uses the actual lua language from an additional dependency dll, so it won't load without this.

To fix, in MQ2PluginHandler.cpp, around line 69, add:

SetDllDirectory(gszINIPath);

Re: Plugin DLL loader does not try the mq2 folder for dependent dll's

Posted: Fri Mar 01, 2019 3:13 am
by silverj
And so you would not need to go and read through the mostly erroneous and outdated Windows documentation, the name of the function may be a little misleading, it does not really set the full dll load path, it only adds a single, process-wide additional search path to each following LoadLibrary/LoadLibraryEx