New菜单项中有专门的线程模板,以下是模板生成的cpp:

 


__fastcall myt::myt(bool CreateSuspended)
    : TThread(CreateSuspended)
{
    FreeOnTerminate=true;
}

void __fastcall myt::xx()
{
    //---- Place thread code here ----
    for(int i=1;i <4;i++)
        Form1->Edit3->Text = Form1->Edit3->Text+"我得" + this->xxx;
}
//---------------------------------------------------------------------------
void __fastcall myt::Execute()
{
    //---- Place thread code here ----
    Synchronize(&xx);   //调用主窗体的控件一定要用Synchronize
}

 

//调用时代码

 

    myt *my = new myt(false);
    my->Priority =tpIdle;    //优先级
    my->xxx="ssd";
    int i =  my->Suspended;
    //my->Start()       ;
   my->Resume();
 

 

 

 

相关文章:

  • 2022-01-02
  • 2021-11-04
  • 2021-11-23
  • 2022-12-23
  • 2021-10-16
  • 2021-11-08
  • 2021-12-10
  • 2021-12-01
猜你喜欢
  • 2022-12-23
  • 2021-07-05
  • 2022-02-26
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案