@@ -3341,14 +3341,19 @@ procedure TPythonInputOutput.UpdateCurrentThreadLine;
3341
3341
(* ******************************************************)
3342
3342
3343
3343
procedure TDynamicDll.DoOpenDll (const aDllName : String);
3344
+ var
3345
+ S: String;
3344
3346
begin
3345
3347
if not IsHandleValid then
3346
3348
begin
3349
+ FDllName := aDllName;
3350
+ S := GetDllPath+DllName;
3351
+
3347
3352
{ $ifdef windows}
3348
- FDLLHandle := Windows.LoadLibrary(PChar(aDllName ));
3353
+ FDLLHandle := Windows.LoadLibrary(PChar(S ));
3349
3354
{ $else}
3350
3355
// Linux: need here RTLD_GLOBAL, so Python can do "import ctypes"
3351
- FDLLHandle := PtrInt(dlopen(PAnsiChar(aDllName ), RTLD_LAZY+RTLD_GLOBAL));
3356
+ FDLLHandle := PtrInt(dlopen(PAnsiChar(S ), RTLD_LAZY+RTLD_GLOBAL));
3352
3357
{ $endif}
3353
3358
end ;
3354
3359
end ;
@@ -3389,7 +3394,7 @@ procedure TDynamicDll.OpenDll(const aDllName : String);
3389
3394
3390
3395
if not IsHandleValid then begin
3391
3396
{ $IFDEF windows}
3392
- s := Format(' Error %d: Could not open Dll "%s"' ,[GetLastError, aDllName ]);
3397
+ s := Format(' Error %d: Could not open Dll "%s"' ,[GetLastError, DllName ]);
3393
3398
{ $else}
3394
3399
s := Format(' Error: Could not open Dll "%s"' ,[DllName]);
3395
3400
{ $ENDIF}
@@ -3454,7 +3459,7 @@ function TDynamicDll.IsHandleValid : Boolean;
3454
3459
3455
3460
procedure TDynamicDll.LoadDll ;
3456
3461
begin
3457
- OpenDll(DllPath + DllName);
3462
+ OpenDll( DllName );
3458
3463
end ;
3459
3464
3460
3465
procedure TDynamicDll.UnloadDll ;
0 commit comments