应用程序正常初始化(0x0000142)失败,跪下了!
下面这个线程引起这个错误,求教高手救命啊,运行一段时间就弹这个错,不运行这个线程就没有问题。
UINT __stdcall SaveJPGThread( void *dummy )
{
CGQ_TESTDlg* pDlg = (CGQ_TESTDlg*)dummy;
int QueueSize = 0;
int ContinueFailed = 0;
char VedioPath[_MAX_PATH];
strcpy(VedioPath,pDlg->m_VedioSavePath.GetBuffer(0));
pDlg->m_VedioSavePath.ReleaseBuffer();
while(!pDlg->m_bQuitThread)
{
EnterCriticalSection( &pDlg->m_JPG_DATA_cs );
QueueSize = pDlg->m_JPGQueue.size();
if(QueueSize > 0)
{
JPG_DATA JPGImg = (JPG_DATA)pDlg->m_JPGQueue.front();
pDlg->m_JPGQueue.pop();
LeaveCriticalSection( &pDlg->m_JPG_DATA_cs );
if(ContinueFailed > 5)
{
theApp.m_Log.Add("写文件连续错误5次!退出程序");
SetEvent( pDlg->m_SaveJPGThreadEvent );
pDlg->m_bSaveVedio = FALSE;
exit(0);
return 0;
}
if(pDlg->SaveJPGImg(JPGImg,VedioPath))
{
ContinueFailed = 0;
}
else
{
theApp.m_Log.Add("存储视频文件错误!");
ContinueFailed++;
}
EnterCriticalSection( &pDlg->m_JPG_DATA_cs );
pDlg->m_JPGBufList[JPGImg.BufNo].bUsed = FALSE;
LeaveCriticalSection( &pDlg->m_JPG_DATA_cs );
}
else
{
LeaveCriticalSection( &pDlg->m_JPG_DATA_cs );
}
if(0 == QueueSize)
{
Sleep(10);
}
}
SetEvent( pDlg->m_SaveJPGThreadEvent );
return 1;
}
BOOL CGQ_TESTDlg::SaveJPGImg(JPG_DATA& pImg,char* pVedioPath)
{
static char fname[_MAX_PATH];
static char strFilePath[_MAX_PATH];
static char strTimeDay[20];
static char strTimeHour[20];
static char strTimeMin[20];
static char strIP[20];
DEVICE_TIME& systime = pImg.ImgInfo.systemtime;
sprintf(strTimeDay,"%04d-%02d-%02d",systime.tm_year,
systime.tm_mon,systime.tm_mday);
sprintf(strTimeHour,"\\%02d",systime.tm_hour );
sprintf(strTimeMin,"\\%02d",systime.tm_min );
sprintf(strIP,"\\%s",pImg.ImgInfo.IP );
strcpy(strFilePath,pVedioPath);
strcat(strFilePath,strTimeDay);
if(!PathFileExists(strFilePath))
{
if(!CreateDirectory(strFilePath,NULL))
{
return FALSE;
}
}
//小时文件夹
strcat(strFilePath,strTimeHour);
if(!PathFileExists(strFilePath))
{
if(!CreateDirectory(strFilePath,NULL))
{
return FALSE;
}
}
//分钟文件夹
strcat(strFilePath,strTimeMin);
if(!PathFileExists(strFilePath))
{
if(!CreateDirectory(strFilePath,NULL))
{
return FALSE;
}
}
//IP文件夹
strcat(strFilePath,strIP);
if(!PathFileExists(strFilePath))
{
if(!CreateDirectory(strFilePath,NULL))
{
return FALSE;
}
}
sprintf(fname,"%s\\%02d-%03d.jpg",
strFilePath,systime.tm_sec,systime.tm_millisecond);
FILE *pFile = fopen(fname,"wb");
if(pFile != NULL)
{
int size = fwrite(pImg.ImgInfo.pImageData,
1,pImg.ImgInfo.Imagelen,pFile);
fclose(pFile);
if(size == pImg.ImgInfo.Imagelen)
{
return TRUE;
}
}
return FALSE;
}
...全文
相关推荐
SQL2000个人版 应用程序正常初始化失败0乘以C0000135失败
SQL2000个人版安装完后遇到的问题,安装然后去点应用程序,上面显示(应用程序正常初始化失败0乘以C0000135失败)。 以前没安装SQL2000个人版以前直接去点应用程序,上面显示的是SQL2000服务器没有安装或运行,怎么回事; 如果打开软件显示“应用程序正常初始化(0xc0000135)失败,表示这个软件使用前需要先安装Mirosoft .NET Framework。 如果您配置的是Ati的X1300或是X1300PRO型号的显卡,安装显卡驱动程序的时候会提示: 您必须选择安装Catalyst control center。 最低的.net Framework版本需要1.1。 请在启
SQL SERVER 2008 R2配置管理器出现“远程过程调用失败”(0x800706be)错误提示
本文主要记录了SQL SERVER 2008 R2配置管理器出现“远程过程调用失败”(0x800706be)错误提示的解决方法,图文并茂,非常的实用,有需要的朋友可以参考下
Windows 2008任务计划执行bat脚本失败返回0x1的解决方法
主要介绍了Windows 2008任务计划执行bat脚本失败返回0x1的解决方法,脚本之家小编一般更倾向于使用vbs来实现功能更强大与简单
安装Win7展开失败错误代码:0x80070570
安装版Win7展开失败错误代码:0x80070570,本人亲身测试,绝对就是这个问题,绝对能够解决展开失败,无论展开百分比是多少!
交互式登录进程初始化失败解决方法.docx
交互式登录进程初始化失败解决方法.docx


