procedure TForm7.Button3Click(Sender: TObject);
var
hthread:thandle;
threadid:Dword;
begin
 hthread:=createthread(nil,0,@rasdial,nil,0,threadid);
end;
function rasdial(p:pointer):Longint;stdcall;
begin
form7.download();
exitthread(uint fuexitcode);
end;
其中exitthread(uint fuexitcode);出错,其参数怎样定义和使用啊?
dwo

解决方案 »

  1.   

    uint fuexitcode的值有什么意义
      

  2.   

    我在download()里面有数据库insert操作,线程结束后再在主界面上执行其他功能时,访问数据库时会报错:connection is busy with rresult for another hstmt.怎么办好?
      

  3.   

    平时都是用delphi封装的TThread,没有用过win32 api建立过线程,你可以看看帮助呀
      

  4.   

    不要在线程中用 exitthread 吧,还有,我也看不出你的 fuexitcode 在那里声明付值啊!!
    象你种处理情况,我建议还是直接从 Tthread 中 继承,生成个新线程处理函数比较简单!
    api createthread 一般适应与那种对反应,效率,实时性要求特别高的地方!