Scripts and Templates can execute functions that reside in an external dynamic link library. The method of declaring and writing these functions is described in the External (DLL) Functions in Scripts help topic. The main difference when executing external functions in Templates is that the Template has to be granted permission to access the dynamic link library.
Granting Permission to Templates for using DLLs
When attempting to use the #link statement inside a Binary Template the following message is displayed:
The Allow button must be clicked to let the Template continue execution otherwise the Template will be stopped with an error. The permissions for executing functions inside DLLs can also be granted or revoked using the Permission Options dialog.