Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2019-02

how to loadlibrary in a specific folder in windows 64?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dennis

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

Reply by email

Marcelo Rocha
to Dennis

try using LoadLibraryEx with the flag LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR

Dennis wrote 36 lines
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 _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email