PDA

View Full Version : [Lape] Can you load plugin from external path?



bg5
02-26-2015, 06:22 PM
I'm testing a plugin and I'm trying to load it directly from output location.

{$loadlib C:\Users\user\Documents\Codeblocks\etl3\bin\Debug\ etl.dll}

,but:

Error: Plugin(C:\Users\user\Documents\Codeblocks\etl3\bin \Debug\etl) has not been found

Have I missed something?

Olly
02-26-2015, 07:00 PM
I think you have to go 'back' (IDK correct syntax) from the plugins directory.

{$loadlib \..\includes\ThisPluginIsInIncludesFolder.dll}

I do also have a pull request pending to search the scripts location for plugins.

Turpinator
02-26-2015, 08:44 PM
I think you have to go 'back' (IDK correct syntax) from the plugins directory.

{$loadlib \..\includes\ThisPluginIsInIncludesFolder.dll}

I do also have a pull request pending to search the scripts location for plugins.

Well... itd be
{$loadlib ..\..\Users\user\Documents\Codeblocks\etl3\bin\Deb ug\etl.dll}
me thinks. the first \ probably will throw it off, because thats generally the root of the drive.

Olly
02-26-2015, 08:48 PM
Well... itd be
{$loadlib ..\..\Users\user\Documents\Codeblocks\etl3\bin\Deb ug\etl.dll}
me thinks. the first \ probably will throw it off, because thats generally the root of the drive.

https://github.com/WarPie/SimbaExt/blob/master/SimbaExt_Core.pas#L84

bg5
02-26-2015, 09:18 PM
{$loadlib \..\..\..\..\..\Users\user\Documents\Codeblocks\et l3\bin\Debug\etl.dll}

worked

btw.

This class is created to handle many plugin dirs.
https://github.com/MerlijnWajer/Simba/blob/65480539458130e559999f99d28046a186f10f10/Units/MMLCore/libloader.pas#L1
all you need to do is to use this function more than once:
https://github.com/MerlijnWajer/Simba/blob/1327b37c83a99d14279c25fd610b134bbcadba39/Projects/Simba/simbaunit.pas#L1975

would be nice if you could add your pathes in settings separated with semicolon, like:

C:\Users\user\Desktop\Simba5\Plugins\;C:\Users\use r\Documents\MyPlugins
and
tempPluginPathArray := Explode(';',SimbaSettings.Plugins.Path.Value);
for i := 0 to length( tempPluginPathArray-1) do
begin
if DirectoryExists(tempPluginPathArray[i]) then
PluginsGlob.AddPath(tempPluginPathArray[i]);
end;