function ReturnCall(P:PChar):Boolean;stdcall;external 'trade.dll '; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var P:PChar; begin try P:=StrAlloc(1024); if ReturnCall(P) then ShowMessage(string(P)); finally StrDispose(P); end; end; dll的如下: uses SysUtils, Classes; function ReturnCall(P:PChar):Boolean;stdcall; begin StrCopy(P, 'this is a demo! '); Result:=True; end; exports ReturnCall; {$R *.res} begin end.