我缺了哪个头文件啊(初学多线程)

heasonjiao 2003-09-03 10:46:01
我初学多线程
我想建立一个全局TCriticalSection 对象,但总是出错

.h中的内容:
//---------------------------------------------------------------------------

#ifndef sensethreadH
#define sensethreadH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include "SenseHandler.h"
//---------------------------------------------------------------------------
extern TCriticalSection mutex;

class sensethread : public TThread
{
private:

protected:
void __fastcall Execute();
public:
SenseHandler *s;
__fastcall sensethread(bool CreateSuspended,SenseHandler *s);
};
//---------------------------------------------------------------------------
#endif

提示错误为:E2141 Declaration syntax error
...全文
72 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
shedow 2003-09-05
  • 打赏
  • 举报
回复
以T开头的是实际上是delph的类。不可直接定义变量。只能定义它的指针,然后new出来
象这样:
TCriticalSection *pCS;
pCS=new TCriticalSection;//这一句可放在你的模块初始化的时候。

Atomictry 2003-09-05
  • 打赏
  • 举报
回复
帮助里有一个Unit说明,那就是了。
huoniao1976 2003-09-03
  • 打赏
  • 举报
回复
class TReadThread : public TThread
{
private:
void __fastcall TReadThread::自己定义的函数();

protected:
void __fastcall Execute();
public:
__fastcall TReadThread(bool CreateSuspended);
};
heasonjiao 2003-09-03
  • 打赏
  • 举报
回复
To:
Atomictry(天影)
我是一个初学者,对c++builder不是很了解,
当我查帮助的时候,找到我要的东西后,
总是找不到它的头文件,
能告诉我怎么去找头文件吗?
万分感谢!
cizi 2003-09-03
  • 打赏
  • 举报
回复
1、SenseHandler *s定义了两次
2、函数的外部定义没有
Atomictry 2003-09-03
  • 打赏
  • 举报
回复
加上这个看看:#include <syncobjs.hpp>

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧