Einzelnen Beitrag anzeigen

STaRDoGGCHaMP

Registriert seit: 1. Okt 2007
34 Beiträge
 
#5

Re: Funktion aus DLL (in C++ geschrieben) nac Delphi importi

  Alt 13. Dez 2009, 21:25
Delphi-Quellcode:
type
  TPoint = record
    x: Integer;
    y: Integer;
  end;

type
  PMove = ^TMove;
  TMove = record
    nJumps: Integer;
    nNewPiece: Integer;
    nOldPiece: Integer;
    pfrom, pto: TPoint;
    pPath: array [0 .. 11] of TPoint;
    pdel: array [0 .. 11] of TPoint;
    nDelPiece: array [0 .. 11] of Integer;
  end;
type
  TBoard = array [0 .. 7, 0 .. 7] of Integer;
procedure TForm1.Button1Click(Sender: TObject);
var
  Dllh: THandle;
  GetMove: function(Board: TBoard; color: Integer; MaxTime: DOUBLE;
    str: array of Char; var playnow: Integer; info: Integer; unused: Integer;
    Move: PMove): Integer; stdcall;
begin
Dllh := LoadLibrary(PChar(ExtractFilePath(Application.ExeName)
        + 'cakeM32.dll'));
@GetMove := GetProcAddress(Dllh, 'getmove');
Klappt nicht
  Mit Zitat antworten Zitat