Finally, the problem is resolved. It was a dynamic array. It looks like it cannot be used as a C-style array. It seems the length prefix is confused with dll. For the entries here is the prototype and use:
A type
type
TArrayOfWideString= array[0..999] of WideString;
Statement
function Identify(var ATemplates: TArrayOfWideString; ATemplatesCount: int64; var ATemplateIndex: int64; var ARetCode: int64): Integer; cdecl; external 'Identify.dll';
Using
var
templateIndex, retCode: int64;
templates: TArrayOfWideString;
retval: integer;
//TODO: range checking for TArrayOfWideString needed
templates[0] := 'template1';
templates[1] := 'template2';
retVal := Identify(templates, 2, scanIndex, retCode);
source
share