[fpc-pascal] how to loadlibrary in a specific folder in windows 64?

Dennis dec12 at avidsoft.com.hk
Fri Feb 8 11:25:35 CET 2019


I am using FPC 3.0.4 Lazarus.
I tried to use synapse with ssl and the unit ssl_openssl_lib 's 
initialization
    runs InitSSLInterface
    which calls
       SSLLibHandle := LoadLib(DLLSSLName);
       SSLUtilHandle := LoadLib(DLLUtilName);

where the var are defined as
   DLLSSLName: string = 'ssleay32.dll';
   DLLUtilName: string = 'libeay32.dll';

it works well.

However, my program also need to call another dll (library) which comes 
with its own set of
ssleay32.dll and libeay32.dll which cannot be used by synapse 's 
ssl_openssl_lib.
ssl_openssl_lib can only loadlibrary successfully the binary dll files 
from https://indy.fulgan.com/SSL/

These clashing of ssl dll is causing me problems.

I tried to put the 2 sets of dll in 2 folders and call 
LoadLibrary('folder1\ssleay32.dll') but  LoadLibrary does not accept any 
file path.  If there is a file path in the name, it just fails.

Please help.

Dennis






More information about the fpc-pascal mailing list