Two files are typically required to create a DLL:
When developing a DLL using a common C/C++ compiler, the source file (.c, .cpp) and the definition file (.def) must be included in the Visual Studio project.
In BDL, all external functions called from a script must be declared before they can be used. This must be done in the external functions section of Silk Performer scripts.
In the following example, the external functions DemoSum and DemoDiff are declared and then called in the TMain transaction.
dll "DemoFunctions.dll"
// function without parameters and return value
"DemoOutput"
function Output;
// function declared using C data types
"DemoSum"
function Sum(in long, in long): long;
// function declared using BDL data types
"DemoDiff"
function Diff(in number, in number): number;
// DLL is not located in the Silk Performer directory
dll "C:\\Debug\\Functions.dll"
dcltrans
transaction TMain
var
x, y, nSum, nDiff: number;
begin
x := 4; y := 5;
nSum := Sum(x, y); // external function calls
nDiff := Diff(x, y);
Output();
end TransMain;