[INCLUDE]
CallFunction
LoadLibrary
FreeLibrary

[CODE]
Public Function CallFunction_Full(ByVal DllFilename As String, ByVal FunctionName As String, ParamArray FunctionParams()) As Long
  Dim xLong1 As Long
  Dim xLong2 As Long
  Dim xLong3 As Long

  xLong1 = LoadLibrary(DllFilename)
  If Not xLong1 = 0& Then
    If Not VarType(FunctionName) = vbString Then FunctionName = "#" + CStr(Val(FunctionName))
    xLong2 = GetProcAddress(xLong1, CStr(FunctionName))
    If Not xLong2 = 0& Then
      ReDim CallFunction_tmpParam(UBound(FunctionParams()) + 1&)
      For xLong3 = 0& To UBound(FunctionParams())
        CallFunction_tmpParam(xLong3) = FunctionParams(xLong3)
        Next
      CallFunction_Full = CallFunction_Real(FunctionAddress)
      End If
    FreeLibrary(xLong1)
    End If
  End Function
