当前位置: 首页 > news >正文

深圳国贸网站建设seo发外链工具

深圳国贸网站建设,seo发外链工具,做公司网站的流程,大剧院网站建设碰到身份证阅读器项目,直接放进trimmer里面读卡,导致主页面卡顿,就打算放进子线程里试一下,就有了这个尝试。 1.创建线程文件 直接点击左上角file新建other,delphi有自带的模版 这个勾选了,就是他会给你…

碰到身份证阅读器项目,直接放进trimmer里面读卡,导致主页面卡顿,就打算放进子线程里试一下,就有了这个尝试。

1.创建线程文件

直接点击左上角file新建other,delphi有自带的模版
在这里插入图片描述
在这里插入图片描述
这个勾选了,就是他会给你的线程取个名字,在execute里面加一行。

NameThreadForDebugging('线程名字');

在这里插入图片描述

标准模版的代码就是这样,有几个注意事项:
1.文件名得和unit后的保持一致
2.在type下面的TestThread得在前面再加一个T变成TTestThread (这是一个约定,表示T=Type,其他的还有 I=Interface E=Exception)
3.在Execute前的TestThread和2同理

unit TestThread;interfaceusesSystem.Classes;typeTTestThread = class(TThread)private{ Private declarations }protectedprocedure Execute; override;end;implementation{ Important: Methods and properties of objects in visual components can only beused in a method called using Synchronize, for example,Synchronize(UpdateCaption);  and UpdateCaption could look like,procedure TestThread.UpdateCaption;beginForm1.Caption := 'Updated in a thread';end; or Synchronize(procedure beginForm1.Caption := 'Updated in thread via an anonymous method' end));where an anonymous method is passed.Similarly, the developer can call the Queue method with similar parameters as above, instead passing another TThread class as the first parameter, puttingthe calling thread in a queue with the other thread.}{ TestThread }procedure TTestThread.Execute;
begin{ Place thread code here }
end;end.

2.使用多线程

在使用上最简单的就是create,create后直接跟False就是一创建就执行里面的execute方法,这里建议是True,然后灵活的用Resume去创建。

procedure TForm1.Button1Click(Sender: TObject);
varTestThread: TTestThread;
beginTestThread := TTestThread.Create(True);TestThread.Resume;
end;//可简化为:
procedure TForm1.Button1Click(Sender: TObject);
beginwith TTestThread.Create(True) do Resume;
end;

3.CreateThread

之前直接调用了TThread.Create,其实底层还是CreateThread方法,现在先介绍下他的结构体。

function CreateThread(lpThreadAttributes: Pointer;           {安全设置}dwStackSize: DWORD;                    {堆栈大小}lpStartAddress: TFNThreadStartRoutine; {入口函数}lpParameter: Pointer;                  {函数参数}dwCreationFlags: DWORD;                {启动选项}var lpThreadId: DWORD                  {输出线程 ID }
): THandle; stdcall;                     {返回线程句柄}

4.子标题

正文

在这里插入代码片

5.子标题

正文

在这里插入代码片
http://www.tj-hxxt.cn/news/105676.html

相关文章:

  • 罗湖网站建设罗湖网站设计职业培训机构哪家最好
  • 徐州网站建设案例品牌推广与传播方案
  • 室内设计网站案例推广平台怎么做
  • 广告优化师招聘seo营销技巧
  • 进入微信官方网站下载怎样在百度上发布广告
  • 织梦网站模板制作天桥区seo全网宣传
  • 云指建站平台经典营销案例
  • 怎样设置 自己的网站关键词全网搜索
  • 网站推广外包宣传产品的方式
  • 抚州市做棋牌网站搜索引擎优化的实验结果分析
  • 精致网站赏析sem工作原理
  • 广州番禺区天气网站优化费用报价明细
  • 重庆自助建网站企企业西安关键字优化哪家好
  • 网络维护人员seo排名怎么看
  • .net网站开发项目关键字
  • 怎么办理网站地址网站百度seo关键词优化
  • 小程序定制开发app青岛seo外包服务
  • 页眉做的好的网站淘宝搜索关键词查询工具
  • 餐饮网站开发线上营销活动案例
  • 网站弹窗特效杭州网站制作排名
  • python语言泉州seo代理商
  • 网站建设的主要功能郑州网站定制
  • 网站开发的调研seo平台是什么
  • 网站建设情况简介怎么注册百度账号
  • 一站式快速网站排名多少钱营销策划是做什么
  • 旅游网站设计说明书b2b采购平台
  • wordpress主题整站网站营销策划公司
  • 公司有没有必要设计网页优化防控措施
  • 做网站配置好了找不到服务器东莞seo建站排名
  • 在柬埔寨做网站开发不能搜的超级恶心的关键词