_fastcall communicationThread::communicationThread(char*projectname):TThread(true) //线程以挂起状态创建
{
sdata=new saveData();
sdata-> Createfile(projectname);
g_wavedata=0;
FreeOnTerminate=true;
Resume();
}
//---------------------------------------------------------------------------
_fastcall communicationThread::~ communicationThread(void) // 类的析构函数
{
delete sdata;
sdata=NULL;
}
//---------------------------------------------------------------------------
void _fastcall communicationThread::Execute(void) //通讯线程
{
unsigned long ByteNumber=0;
while(!Terminated)
{
unsigned short i=0;
if ( ReadFile(Hpipe, &buffer[0], 128, &ByteNumber, NULL))//加上这句 就出问题了 不加则无任何问题
commThread=new communicationThread(frmTestenter-> path); // 通讯子线程开启
commThread-> Priority =tpTimeCritical; |