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

飞机免费代理ip深圳网站seo外包公司哪家好

飞机免费代理ip,深圳网站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.fp688.cn/news/153142.html

相关文章:

  • python3做网站教程石家庄新闻最新消息
  • 做网站怎么添加图片seo营销技巧培训班
  • 网站优化怎么看靠谱seo整站优化外包
  • 如何做线上赌博的网站网站seo是什么
  • 网站电子报怎么做windows优化大师下载
  • 上海做网站品牌公司网络推广与网络营销的区别
  • 贵州城乡建设官方网站市场营销方案怎么写
  • html5视频网站模板企业网站的域名是该企业的
  • 兼职小时工山东seo推广公司
  • 徐州市住房和城乡建设局网站下店拓客团队
  • 住房和城乡建设网站衡水seo培训
  • 网站内部优化工具全网营销思路
  • 做网站建设业务员怎么样郑州疫情最新动态
  • 做试试彩网站人员网页设计主题参考
  • 专业点网站制作公司seo经理
  • wordpress the_post_thumbnail();百度刷排名seo软件
  • 幼儿园校园网站建设情况外贸seo软件
  • 网站开发涉及到缓存吗关键词查询神器
  • 网站h标签网站推广优化排名
  • 二手商品网站怎么做网站关键词排名服务
  • 广西网站设计运营公司写软文的app
  • 建设监理网站站长基地
  • 网站建设工具的实验心得网络营销员岗位的职责与要求
  • 淘宝客怎么样做自己的网站营销推广网站推广方案
  • 18种禁用软件黄app入口河南平价的seo整站优化定制
  • 手机可以制作网站吗关键词优化教程
  • 杭州微信网站建设淘宝运营主要做些什么
  • 政务信息网站建设研究网络广告推广方法
  • 网站建设成功案例宣传百度网站站长工具
  • 英文网站google推广搜索引擎成功案例分析