calling a (complex) method in external C dll (see below the header) the code works fine in Excel VBA (passing correctly all the arrays) while I get the error “BASIC runtime error. ‘73’ Not implemented.” from LibreOffice (in debugging phase, when calling mytest method), can you help with this error 73 ?
Should I adopt a different way to pass parameters ?
** C header (windows, test.dll) **
__declspec(dllexport) int WINAPI mytest(int,int,int,double*,double*,double*,double*,int,int,int,int*,int*,int,int*,int*,int*,double*,int,double*,int*,int*,int*,double*,double*);
** VBA in Excel 2016 **
Private Declare PtrSafe Function mytest Lib "test.dll" (ByVal csep As Long, ByVal stgnr As Long, ByVal init As Long, ByRef stgt As Double, ByRef stgp As Double, ByRef stgef As Double, ByRef stgdH As Double, ByVal prod_h As Long, ByVal btm_h As Long, ByVal fnr As Long, ByRef fstr As Long, ByRef fpos As Long, ByVal snr As Long, ByRef sstr As Long, ByRef spos As Long, ByRef sft As Long, ByRef sflow As Double, ByVal vnr As Long, ByRef vrv As Double, ByRef vtype As Long, ByRef stype As Long, ByRef siv As Long, ByRef srv As Double, ByRef flows As Double) As Long
Dim stgp(0 To 100) As Double
Dim stgt(0 To 100) As Double
Dim stgef(0 To 100) As Double
Dim stgdH(0 To 100) As Double
Dim flows(0 To 2 * 100 * 100) As Double
Dim sstr(0 To 2) As Long
Dim spos(0 To 2) As Long
Dim sft(0 To 2) As Long
Dim sflow(0 To 2) As Double
Dim fstr(0 To 2) As Long
Dim fpos(0 To 2) As Long
Dim vrv(0 To 1) As Double
Dim vtype(0 To 1) As Long
Dim stype(0 To 1) As Long
Dim siv(0 To 1) As Long
Dim srv(0 To 1) As Double
csep = 1
stgnr = 20
init = 1
prod = 2
btm = 1
fnr =2
snr = 2
vnr = 2
res = mytest(csep, stgnr, init, stgt(0), stgp(0), stgef(0), stgdH(0), prod, btm, fnr, fstr(0), fpos(0), snr, sstr(0), spos(0), sft(0), sflow(0), vnr, vrv(0), vtype(0), stype(0), siv(0), srv(0), flows(0))
** the same code converted to Libre Office **
(when executed, reports error : BASIC runtime error. '73' Not implemented.)
Private Declare Function mytest Lib "test.dll" (ByVal csep As Long, ByVal stgnr As Long, ByVal init As Long, stgt(), stgp(), stgef(), stgdH(), ByVal prod_h As Long, ByVal btm_h As Long, ByVal fnr As Long, fstr(), fpos(), ByVal snr As Long, sstr(), spos(), sft(), sflow(), ByVal vnr As Long, vrv(), vtype(), stype(), siv(), srv(), flows()) As Long
Dim stgp(0 To 100) As Double
Dim stgt(0 To 100) As Double
Dim stgef(0 To 100) As Double
Dim stgdH(0 To 100) As Double
Dim flows(0 To 2 * 100 * 100) As Double
Dim sstr(0 To 2) As Long
Dim spos(0 To 2) As Long
Dim sft(0 To 2) As Long
Dim sflow(0 To 2) As Double
Dim fstr(0 To 2) As Long
Dim fpos(0 To 2) As Long
Dim vrv(0 To 1) As Double
Dim vtype(0 To 1) As Long
Dim stype(0 To 1) As Long
Dim siv(0 To 1) As Long
Dim srv(0 To 1) As Double
csep = 1
stgnr = 20
init = 1
prod = 2
btm = 1
fnr =2
snr = 2
vnr = 2
res = mytest(csep, stgnr, init, stgt(), stgp(), stgef(), stgdH(), prod, btm, fnr, fstr(), fpos(), snr, sstr(), spos(), sft(), sflow(), vnr, vrv(), vtype(), stype(), siv(), srv(), flows())