边
边尘浪子
Unregistered / Unconfirmed
GUEST, unregistred user!
<br>一个是直接调用 MyTest 一个是创建了线程来调用MyTest<br>前面的 直接调用就对的, 后面的这个就会出错<br><br>怎么回事? 高手办我看看,说明理由<br><br>/////////////////代码如下///////////////<br>unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br> Dialogs, StdCtrls;<br><br>type<br> Lp = ^L;<br> L = packed record<br> i:integer;<br> end;<br><br>type<br> TForm1 = class(TForm)<br> Button1: TButton;<br> procedure Button1Click(Sender: TObject);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>var<br> llpp:LP;<br> ll:L;<br><br>implementation<br><br>{$R *.dfm}<br>function MyTest(llpp_:LP):boolean;<br>var<br> ll_:L;<br>begin<br> ll_:=llpp_^;<br> ShowMessage(IntToStr(ll.i));<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> d:dword;<br>begin<br> ll.i:=100;<br> llpp:=@ll;<br>// MyTest(llpp);<br> CreateThread(nil,0,@MyTest,llpp,0,d);<br>end;<br><br>end.