if(Time >Iner)                                   
{
MessageBox("end");

fclose(file);
m_pThread->PostThreadMessage(WM_DESTROY,0,0);
if (WAIT_OBJECT_0 == WaitForSingleObject(m_pThread->m_hThread, INFINITE))  
{  
// 3. 删除 UI 线程对象,只有当你设置了m_bAutoDelete = FALSE; 时才调用   
delete   m_pThread;   

CloseHandle(m_hCom);  return 0;

}