向文件里写内容 写一段时间之后,m_pStream为空了,该怎么解决
向文件里写内容 写一段时间之后,m_pStream为空了
向文件里写内容 写一段时间之后,m_pStream为空了,一开始并不是为零,运行一会就为空了。
CStdioFile定义了新的成员变量m_pStream,类
------解决方案--------------------
代码都不贴,怎么回答?
------解决方案--------------------
while (TRUE)
{
WaitForSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);
if (g_pPlateView->m_iSystemSta != STA_SCAN)
{
TRACE("DataSave Thread Exit! =========\n");
FileExport.Close();
pForcePlateView->m_FileAnayse.Close();
}
你没有释放资源,光有WaitForSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);
------解决方案--------------------
while (TRUE)
{
WaitForSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);
if (g_pPlateView->m_iSystemSta != STA_SCAN)
{
TRACE("DataSave Thread Exit! =========\n");
FileExport.Close();
pForcePlateView->m_FileAnayse.Close();
}
关闭后,是否要退出while?
------解决方案--------------------
while (TRUE)
{
WaitForSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);
if (g_pPlateView->m_iSystemSta != STA_SCAN)
{
TRACE("DataSave Thread Exit! =========\n");
FileExport.Close();
pForcePlateView->m_FileAnayse.Close();
LeaveSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);//加这条语句,函数可能不对,但一查就能查到
}
向文件里写内容 写一段时间之后,m_pStream为空了,一开始并不是为零,运行一会就为空了。
CStdioFile定义了新的成员变量m_pStream,类
------解决方案--------------------
代码都不贴,怎么回答?
------解决方案--------------------
while (TRUE)
{
WaitForSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);
if (g_pPlateView->m_iSystemSta != STA_SCAN)
{
TRACE("DataSave Thread Exit! =========\n");
FileExport.Close();
pForcePlateView->m_FileAnayse.Close();
}
你没有释放资源,光有WaitForSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);
------解决方案--------------------
while (TRUE)
{
WaitForSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);
if (g_pPlateView->m_iSystemSta != STA_SCAN)
{
TRACE("DataSave Thread Exit! =========\n");
FileExport.Close();
pForcePlateView->m_FileAnayse.Close();
}
关闭后,是否要退出while?
------解决方案--------------------
while (TRUE)
{
WaitForSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);
if (g_pPlateView->m_iSystemSta != STA_SCAN)
{
TRACE("DataSave Thread Exit! =========\n");
FileExport.Close();
pForcePlateView->m_FileAnayse.Close();
LeaveSingleObject(g_pPlateView->m_hWriteEvent,INFINITE);//加这条语句,函数可能不对,但一查就能查到
}