Skip to main content
Known Participant
March 24, 2017
Question

How do I get MyPlugIn.api to find my additional DLLs?

  • March 24, 2017
  • 2 replies
  • 683 views

I am trying to do the following. BasicPlugin.api calls a managed C++ DLL. That DLL calls a C# DLL (which has all the code I want to add to the plug in).

According to VisualStudio's debugger, the plugin is finding, loading, & calling the managed C++ dll. It is failing to find the C# dll.

According to fuslogvw.exe, neither of them can be found because it is looking in file:///C:/Program Files (x86)/Adobe/Acrobat DC/Acrobat for the files, not C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\plug_ins.

What's the solution for this? The only thing I can think of is to explicitly call LoadLibrary() which strikes me as kludgy.

Or maybe have the C++ plug-in directly call C# but that is a lot more complex and brings COM into the picture (yuck).

thanks - dave

This topic has been closed for replies.

2 replies

Dan_Korn
Inspiring
March 27, 2017

Install the DLL into "C:\Windows\SysWOW64" on 64-bit Windows, or "C:\Windows\System32" on 32-bit Windows.

Legend
March 25, 2017

This is a classic problem for many apps with plug-ins, and a surprise for programmers used to freely bundling DLL files in the install folder for EXE files. An Acrobat plug-in (*.API) is just a DLL file renamed. Acrobat scans the plug_ins folder and immediate subfolders, and uses LoadLibrary. Using LoadLibrary doesn't change the DLL search order; it continues to contain the EXE folder (i.e. the EXE folder for Acrobat), some system folders, and others, but never the plug_ins folder.

You definitely shouldn't add the DLL to Acrobat's EXE folder, and most people don't want to deploy to the system. Worth reviewing Windows' rules to see if anything is suitable, but LoadLibrary is probably your best bet, we're already in LoadLibraryLand. Another advantage is that we get diagnostics from load failure and can report them more clearly, rather than the plug-in load just failing with no message anywhere.