Delphi LoadLibrary Failing to find DLL other directory - any good options?

后端 未结 3 1972
忘了有多久
忘了有多久 2021-01-15 09:44

Two Delphi programs need to load foo.dll, which contains some code that injects a client-auth certificate into a SOAP request. foo.dll resides in c:\\fooapp\\foo.dll and is

3条回答
  •  渐次进展
    2021-01-15 10:20

    This is not exactly a solution for the question asked, but it would have helped me, when I stumpled upon this question:

    You can extend the search path for LoadLibrary via SetDllDirectory.

    From MSDN-Doku:

    The search path can be altered using the SetDllDirectory function. This solution is recommended instead of using SetCurrentDirectory or hard-coding the full path to the DLL.

    You would have needed to add one line before your LoadLibrary call(s):

    SetDllDirectory(PChar('c:\fooapp'));
    

提交回复
热议问题