I've been passed a dll file called AA_R.dll with the following instructions in a pdf about the dll. Basically by passing the dll the INPUT information below it will calculate and return the OUTPUT information below. Can anyone help me with a code example on how i could get this to work with VB or VBA, thanks?
Declaration of the calculation-procedure (Pascal)
type A_INPUT = array[1..4] of double;
A_OUTPUT = array[0..5] of double;
procedure A_CALC(
var a1 : integer;
var a2 : integer;
var B_INPUT : A_INPUT;
var a3 : integer;
var a4 : integer;
var B_OUTPUT : A_OUTPUT
); stdcall;
- the type double consists of 8 byte.
- the type integer consists of 2 byte.
Parameters of the procedure and their values
INPUT
PARAMETER VALUE UNIT
a1 without value
a2 without value
a3 without value
a4 without value
(You will need a1, a2, a3, a4 e.g., when you call the procedure.)
B_INPUT[1] pressure mbar
B_INPUT[2] air volume m³/h
B_INPUT[3] temperature °C
B_INPUT[4] humidity %
OUTPUT
PARAMETER VALUE UNIT
B_OUTPUT[0] Error Message
B_OUTPUT[1]-B_OUTPUT[4] B_INPUT[1]-B_INPUT[4]
B_OUTPUT[5] Total €
I've tried the following in Access VBA but i'm not really sure if i'm going down the right tracks:
Option Compare Database
Private Declare Function test Lib "C:\AA_R.dll" Alias "A_CALC" (ByVal a1 As Integer, ByVal a2 As Integer, ByVal B_INPUT As Double, ByVal a3 As Integer, ByVal a4 As Integer, ByVal B_OUTPUT As Double) As Long
Private Sub Command0_Click()
Dim testarray(4) As Double
Dim testarray2(6) As Double
testarray(0) = 1013
testarray(1) = 200
testarray(2) = -5
testarray(3) = 90
Call test(0, 0, testarray, 0, 0, testarray2)
Msgbox testarray2(0)
End Sub
Declaration of the calculation-procedure (Pascal)
type A_INPUT = array[1..4] of double;
A_OUTPUT = array[0..5] of double;
procedure A_CALC(
var a1 : integer;
var a2 : integer;
var B_INPUT : A_INPUT;
var a3 : integer;
var a4 : integer;
var B_OUTPUT : A_OUTPUT
); stdcall;
- the type double consists of 8 byte.
- the type integer consists of 2 byte.
Parameters of the procedure and their values
INPUT
PARAMETER VALUE UNIT
a1 without value
a2 without value
a3 without value
a4 without value
(You will need a1, a2, a3, a4 e.g., when you call the procedure.)
B_INPUT[1] pressure mbar
B_INPUT[2] air volume m³/h
B_INPUT[3] temperature °C
B_INPUT[4] humidity %
OUTPUT
PARAMETER VALUE UNIT
B_OUTPUT[0] Error Message
B_OUTPUT[1]-B_OUTPUT[4] B_INPUT[1]-B_INPUT[4]
B_OUTPUT[5] Total €
I've tried the following in Access VBA but i'm not really sure if i'm going down the right tracks:
Option Compare Database
Private Declare Function test Lib "C:\AA_R.dll" Alias "A_CALC" (ByVal a1 As Integer, ByVal a2 As Integer, ByVal B_INPUT As Double, ByVal a3 As Integer, ByVal a4 As Integer, ByVal B_OUTPUT As Double) As Long
Private Sub Command0_Click()
Dim testarray(4) As Double
Dim testarray2(6) As Double
testarray(0) = 1013
testarray(1) = 200
testarray(2) = -5
testarray(3) = 90
Call test(0, 0, testarray, 0, 0, testarray2)
Msgbox testarray2(0)
End Sub