//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// Important: Methods and properties of objects in VCL can only be
// used in a method called using Synchronize, for example:
//
// Synchronize(UpdateCaption);
//
// where UpdateCaption could look like:
//
// void __fastcall thread1::UpdateCaption()
// {
// Form1->Caption = "Updated in a thread";
// }
//---------------------------------------------------------------------------
void __fastcall thread1::MY_add(void)
{
int i;
i = StrToInt(Form1->Edit3->Text);
i++;
Form1->Edit3->Text = IntToStr(i);
Form1->Memo1->Lines->Add("1:" + IntToStr(i));
}
__fastcall thread1::thread1(bool CreateSuspended)
: TThread(CreateSuspended)
{
}
//---------------------------------------------------------------------------
void __fastcall thread1::Execute()
{
//---- Place thread code here ----
int i,j;
for(j=0;j<1000;j++)
{
if(Form1->RadioButton1->Checked)
Synchronize(MY_add);
else
{
i = StrToInt(Form1->Edit3->Text);
i++;
Form1->Edit3->Text = IntToStr(i);
Form1->Memo1->Lines->Add("1:" + IntToStr(i));
}
Sleep(10);
}
}
//---------------------------------------------------------------------------
bcb6多线程计数器
需积分: 9 58 浏览量
2008-10-20
23:21:17
上传
评论
收藏 323KB RAR 举报
zhgwbzhd
- 粉丝: 27
- 资源: 1
最新资源
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
- 音乐展示网页、基于Stenography的图像数字水印添加与提取,以及基于颜色矩和Tamura算法的图像相似度评估算法py源码
- 基于EmguCV(OpenCV .net封装),图像数字水印加解密算法的实现,其中包含最低有效位算法,离散傅里叶变换算法+文档书
- 基于matlab+DWT的图像水印项目,数字水印+源代码+文档说明+图片+报告pdf
- (优秀毕业设计)基于python实现的数字图像可视化水印系统的设计与实现,多种数字算法实现+源代码+文档说明+理论演示pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈