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

Marcelo Rocha mcrocha at gmail.com
Fri Feb 8 12:53:27 CET 2019


try using LoadLibraryEx with the flag LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR

Em sex, 8 de fev de 2019 às 08:26, Dennis <dec12 at avidsoft.com.hk> escreveu:

> 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  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190208/b01ac6f5/attachment.html>


More information about the fpc-pascal mailing list