@ Neutral General:
Mist, hast Recht - dann muss man das eben so machen:
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
PInteger = ^Integer;
TForm1 =
class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Function Test (a: PInteger): Integer;
begin
ShowMessage(IntToStr(a^));
Result := a^;
Dispose(a);
end;
procedure TForm1.FormCreate(Sender: TObject);
var ID: Cardinal;
Handle: THandle;
I: PInteger;
begin
New(I);
I^ := 20;
Handle := BeginThread(
nil, 0, @Test, @I, 0, ID);
end;
end.