コード例 #1
0
ファイル: zogvmDlg.cpp プロジェクト: dulton/brpj
DWORD WINAPI BuildThreadPROC(LPVOID lpParameter)
{
	struct HDD_ST  hddst;
	memcpy(&hddst,(struct HDD_ST *)lpParameter,sizeof(struct HDD_ST));

	char tempstr[256];

	list<struct FILETYPE_ST> typeList;
	typeList.clear();
	SQLDB.Type_Read(typeList); 

	list<struct ZIDIAN_ST> zidianList;
	zidianList.clear();
	SQLDB.ZiDian_Read(zidianList); 

	sprintf(tempstr,"%s %s :建目录中..",hddst.serno,hddst.mark);
	pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);

	//建目录
	FindAllFile(hddst.hdd_nid,hddst.area,typeList,zidianList);

	sprintf(tempstr,"%s %s :判断文件是否存在..",hddst.serno,hddst.mark);
	pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);

	//缺少 关联 IDX代码
	SQLDB.File_CleanIDX(hddst.hdd_nid);

	//查看文件是否存在
	CheckAllIsFile(hddst.hdd_nid);


	//设置自己查找完毕
	list<struct HDD_ST>::iterator beglist;

	for(beglist=pZogvmDlg->hddList.begin();beglist!=pZogvmDlg->hddList.end();beglist++)
	{
		if(beglist->hdd_nid == hddst.hdd_nid)
		{
			beglist->dealstep=DEALSTEP_FIND_END;
			break;
		}
	}
	//判断是否全部完结
	bool flag=true;
	//等待全部完结后 查重
	while(flag)
	{
		flag=false;
		for(beglist=pZogvmDlg->hddList.begin();beglist!=pZogvmDlg->hddList.end();beglist++)
		{
			if(DEALSTEP_START  == beglist->dealstep)
			{
				flag=true;
				Sleep(1000);
				break;
			}
		}
	}
	
	sprintf(tempstr,"%s %s :判断重复文件..",hddst.serno,hddst.mark);
	pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);

	//查看重复文件
	CheckAllDoubleFile(hddst.hdd_nid);


	sprintf(tempstr,"%s %s :扫描完毕",hddst.serno,hddst.mark);
	pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);
	
	//设置自己完毕
	for(beglist=pZogvmDlg->hddList.begin();beglist!=pZogvmDlg->hddList.end();beglist++)
	{
		if(beglist->hdd_nid == hddst.hdd_nid)
		{
			beglist->dealstep=DEALSTEP_ALL_END;
			break;
		}
	}
		
	//判断是否全部完结
	flag=true;
	for(beglist=pZogvmDlg->hddList.begin();beglist!=pZogvmDlg->hddList.end();beglist++)
	{
		if(DEALSTEP_ALL_END  != beglist->dealstep)
		{
			flag=false;
			break;
		}
	}
	
	if(flag)
	{
		bbbb=GetTickCount()-aaaa;
		sprintf(tempstr,"全部扫描完毕~么么哒 耗时%I64u分钟",bbbb/60000);
		pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);
		pZogvmDlg->GetDlgItem(IDC_BUTTON_BUILD)->EnableWindow(TRUE);
	}

	return 0;
}
コード例 #2
0
ファイル: zogvmDlg.cpp プロジェクト: dulton/brpj
DWORD WINAPI BuildThreadPROC(LPVOID lpParameter)
{

	CZogvmDlg *pDlg=(CZogvmDlg *)lpParameter;

	char tempstr[256];

	pDlg->hddList.clear();
	//几个硬盘开几个线程
	SQLDB.Hdd_Read(pDlg->hddList);

	list<struct FILETYPE_ST> typeList;
	typeList.clear();
	SQLDB.Type_Read(typeList); 

	list<struct ZIDIAN_ST> zidianList;
	zidianList.clear();
	SQLDB.ZiDian_Read(zidianList); 

	list<struct HDD_ST>::iterator beglist;

	for(beglist=pDlg->hddList.begin();beglist!=pDlg->hddList.end();beglist++)
	{
		if(beglist->insertflag && beglist->enable)
		{
			sprintf(tempstr,ConvertString("%s %s :建目录中.."),beglist->serno,beglist->mark);
			pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);

			//建目录
			FindAllFile_NEW(beglist->hdd_nid,beglist->area,typeList,zidianList);

			//缺少 关联 IDX代码
			SQLDB.File_CleanIDX(beglist->hdd_nid);

			sprintf(tempstr,ConvertString("%s %s :判断文件是否存在.."),beglist->serno,beglist->mark);
			pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);
			//查看文件是否存在
			CheckAllIsFile(beglist->hdd_nid);

		}
	}

	for(beglist=pDlg->hddList.begin();beglist!=pDlg->hddList.end();beglist++)
	{
		if(beglist->insertflag && beglist->enable)
		{
			sprintf(tempstr,ConvertString("%s %s :判断重复文件.."),beglist->serno,beglist->mark);
			pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);
			//查看重复文件
			CheckAllDoubleFile(beglist->hdd_nid);
		}
	}

	bbbb=GetTickCount()-aaaa;
	sprintf(tempstr,ConvertString("全部扫描完毕~么么哒 耗时%I64u分钟"),bbbb/60000);
	pZogvmDlg->GetDlgItem(IDC_STATIC_MSG)->SetWindowText(tempstr);
	pZogvmDlg->GetDlgItem(IDC_BUTTON_BUILD)->EnableWindow(TRUE);
	

	return 0;
}