线程函数和创建线程
刚学这个 不懂额。然后看书自己写 有些地方错误的。
DWORD WINAPI ThreadFunc(LPVOID lpParameter)
{
for(int i=1;i<=100000;i++)
{
Form1->label1->Caption = i;
}
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int hHandle;
DWORD threadID;
hHandle = (int)CreateThread(NULL, 0, ThreadFunc, (void*)this, 0, &threadID);
if(hHandle == 0)
{
MessageBox(Handle, "没有线程", NULL, MB_OK);
}
}
这样为什么错的哦 谁帮我看看哦
还有TFormThreadSample是个什么类 干嘛
[解决办法]
该回复于2011-07-01 10:58:34被版主删除