To razy: CreateThread的参数我都知道,但就是传递过去的参数的值并不正确。这是我的代码:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure thread(x:integer);
stdcall;
begin
showmessage(inttostr(x));
end;
procedure TForm1.FormCreate(Sender: TObject);
var i:integer;
threadid:dword;
begin
i:=5;
createthread(nil,0,@thread,@i,0,threadid);
end;
end.
如果你能给出完整的例子,我立马给分。