I'm having some problems calling C++ DLLs in delphi, the DLLs are written in Labview but the DLL syntax is all C++, I think the main issue is to do with trying to pass data to the function as a dynamic array of double (which is inherently a pointer right?)
the function definition in the.h header file is:
int16_t __cdecl NRELIVparExtract(
double voltageV[],
double currentA[],
int32_t nDataPoints,
uint16_t fitAlgorithim,
int16_t *twoOrLessPoints,
double *Voc,
double *Isc,
double *Vmp,
double *Imp
);
My delphi code i'm trying to use to call it is:
public { Public declarations }
end;
var
Function NRELIVparExtract (voltageV, currentA: Array of Double; nDataPoints :Integer;
fitAlgorithim :Word; Var twoOrLessPoints : SmallInt;
Voc, Isc, Vmp, Imp : Double): smallint ; CDecl;External IVparExtract_NREL.dll'
blah
procedure TFormMainIVanalysis.ExtractNREL(InputFileName : ShortString);
var
VoltArray, CurrArray : Array Of double;
blah
Begin
NRELresult := NRELIVparExtract(VoltArray,CurrArray,NpointsForFitting, fitAlgorithm, twoOrLessPoints, LVoc, LISc, LVmpp, LImpp);
I variously get either an access violation error when the compiler gets to the begin line in my delphi .dpr OR I get IVparExtract_NREL.dll not found
any suggestions very welcome, cheers, Brian