On Microsoft Windows, a foreign function that can be invoked from a user exit is contained in a dynamic link library(DLL). A DLL is a library that loads into memory only when the contained code is invoked, and a DLL can be shared by multiple applications. Before proceeding, you should be familiar with the procedure for building DLLs, as described in your compiler manual.
Note: Some C runtime functions are not available in .DLL files. For more information, refer to your compiler documentation.
Compiling Microsoft Windows foreign functions