Hallo STaRDoGGCHaMP.
Probier einfach mal folgendes durch:
Delphi-Quellcode:
type
TPoint = packed record
x: Integer;
y: Integer;
end;
type
PMove = ^TMove;
TMove = packed record
nJumps : Integer;
nNewPiece : Integer;
nOldPiece : Integer;
pfrom : TPoint;
pto : TPoint;
pPath : array [0..11] of TPoint;
pdel : array [0..11] of TPoint;
nDelPiece : array [0..11] of Integer;
end;
TBoard = array [0..7, 0..7] of Integer;
TStr = array [0..254] of Char;
var
GetMove: function(Board: TBoard; color: Integer; maxtime: Double; str: TStr;
var playnow: Integer; info: Integer; unused: Integer;
move: PMove): Integer stdcall;
GetMoveEx: function(Board: TBoard; color: Integer; maxtime: Double; str: TStr;
var playnow: Integer; info: Integer; unused: Integer;
move: PMove): Integer cdecl;
Dynamische arrays von Delphi nach C sind problematisch, wie soll C die länge wissen?
Womöglich spielt Alignment (hier 32 Bit) eine Rolle, wenn C z.B. über Offset (Index) auf die Struct Inhalte zugreift?
Wenn man den C Source nicht kennt, immer annehmen das die Structs aligned sind (packed records verwenden).
Womöglich ist die
Dll nicht stdcall sondern cdecl?
lg. Astat