I have to call a REST API. I first wrote a standard Delphi VCL Forms Application to test calling the API and it worked 100%. I then moved the code into my COM+ application. I compiled the DLL and registered it in Component Services (as per normal). I set the break-point in my DLL and ran it - while DLL is running I started my HOST application that allowed me to debug my DLL. When I run it with the DLL in debug mode, everything is still working 100%.
The problem is that when the DLL is not running in debug mode, but I run the HOST application (stand alone or from IDE), I get a "Could not load SSL Library" error when trying to call the REST API. Both the libeay32.dll and ssleay32.dll files are in the same directory as my DLLs. I doubled check my component services and that is also pointing to the same directory.
Question: Where do I need to put the libeay32.dll and ssleay32.dll files in order for my COM+ DLL to see and load them?
The irony is that I cannot debug because then it works. I have tried WhichFailedToLoad() but that gives me an access violation.
IdOpenSSLSetLibPath()function so you can tell Indy to load the OpenSSL DLLs using absolute paths in a specific folder. And Windows hasSetDllDirectory()andAddDllDirectory()functions to add additional search paths when loading DLLs by relative paths (what Indy does by default). Use one of those approaches instead. Your DLL can retrieve its own path at runtime and then update Indy/Windows accordingly before Indy loads the OpenSSL DLLs. - Remy Lebeau