|
The code examples below show how to call an Erlang DLL Function. In this
example, the blocking probability is being calculated using the Erlang
C model. The inputs are the number of servers (i.e.. circuits), and the
total offered traffic (in Erlangs).
ANSI C
#include “dll_erlc.h”
int iNumServ = 12;
double dErlangs = 10.0; //Erlangs
HINSTANCE hErlangCDLL;
double dProb;
hErlangCDLL = LoadLibrary(“erlangc.dll”);
dProb = ERLC_CalcProb(dErlangs, iNumServ);
FreeLibrary(hErlangCDLL);
Visual Basic
Private Declare Function ERLC_CalcProb Lib "c:\erlangc.dll"
(ByVal dErlangs As Double, ByVal iNumServ As Long) As Double
Dim iNumServ As Long
Dim dErlangs As Double
Dim dProb As Double
iNumServ = 12
dErlangs = 10.0 ‘Erlangs
dProb = ERLC_CalcProb(dErlangs, iNumServ)
|