That syntax is for a statically linked DLL. ie. you cant change it at runtime.
For a dynamically linked DLL use this code:
[pascal:1:9ee0a51a59]procedure TForm1.Button1Click(Sender: TObject);
Var LibName: string;
LibHandle: THandle;
MyFunction: Function(a,b: integer): boolean;
begin
LibName := 'myplugin.dll'
LibHandle := LoadLibrary(pansichar(Libname));
if LibHandle <> 0 then
MyFunction := GetProcAddress(LibHandle, 'MyFunctionName');
//Use MyFunction here!!
MyFunction(10, 20);
FreeLibrary(LibHandle);
//You can no longer use MyFunction after freeing the library.
end;
[/pascal:1:9ee0a51a59]
Bookmarks