Simba doesn't see my dll plugin ,since I used custom type (TIntegerArray). How to fix that ?
This is my dll file:
SCAR Code:
library Mylib;
uses
FastShareMem,
SysUtils,
Classes,
Windows,
Graphics;
{$R *.res}
Function MiddleBox(X1, Y1, X2, Y2 : Integer): TPoint; stdcall;
Begin
Result.X := (X1 + X2) Shr 1;
Result.Y := (Y1 + Y2) Shr 1;
End;
type
TIntegerArray = array of integer;
T2dIntegerArray = array of TIntegerArray;
Function BmpToTIA(DC : integer): T2dIntegerArray; Stdcall;
Var
I, J ,w ,h : Integer;
B : TBitmap;
Begin
try
B := TBitmap.Create;
B.Canvas.Handle := DC;
w := B.Width;
h := B.Height;
SetLength(Result,w);
For I:= 0 to w-1 Do
SetLength(Result[I],h);
For I := 0 to w-1 Do
For J := 0 to h-1 Do
Result[I][J] := B.Canvas.Pixels[I, J];
B.Free;
except
writeln('Exeption in BmpToTIA');
end;
End;
function GetFunctionCount(): Integer; stdcall; export;
begin
Result := 2;
end;
function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PChar): Integer; stdcall;
begin
case x of
0:
begin
ProcAddr := @MiddleBox;
StrPCopy(ProcDef, 'function MiddleBox(X1, Y1, X2, Y2 : Integer): TPoint;');
end;
1:
begin
ProcAddr := @BmpToTIA;
StrPCopy(ProcDef, 'Function BmpToTIA(DC : integer): T2dIntegerArray');
end;
else
x := -1;
end;
Result := x;
end;
exports GetFunctionCount;
exports GetFunctionInfo;
end.