DLL Interface

The COM DLL library also export functions that can be imported by any tool developed with coding languages that support DLL imported functions.

One of the advantages of this interface is the fact the DLL is only initialized one time, and not each time a function is called, as is the case with the command line interface. This results in faster execution when tasks need to execute multiple function calls.

All the tools with command line interface also have a DLL related exported function. All the functions use the same syntax.

In C language:

void CALLBACK EntryPoint(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow);

Only the hwnd (window handle used to reference the owner window for any windows the tools create) and the lpszCmdLine (tool command line arguments, equivalent to the command line interface tool command line arguments) parameters are internally used.

The EntryPoint function name of this generic function should be replaced by the tool exported function name, that is the same name referenced in the tools command line sections of this guide.
Example of declaration of the Merge function, in Delphi language:

function Merge(hWnd:THandle;hInst:Cardinal;lpszCmdLine:PChar;nCmdShow:Integer):Cardinal;stdcall;external 'PDFShellTools.dll'

This interface can be called using the Windows Rundll32 tool, as shown in this merge function example.

Rundll32 "C:\Program Files\PDF-ShellTools\PDFShellTools.dll",Merge "C:\My docs\File1.PDF;C:\My Docs\File2.pdf"

Using this method doe not provide performance advantages over using the command line interface, but it can be handy when the caller wants to hide the Win32 console window.

 

(c) 2006-2017 RTT