while(1)
{
fgets(source,10240,fpsc);
CString StrSc(source);
StrSc.GetBuffer (10240);
//生成find文件
//使生成数据起始位置为空,让有效记录能从文件头开始生成!
memset(findRecord,0,10240);
//生成del文件
//使生成数据起始位置为空,让有效记录能从文件头开始生成!
memset(delRecord,0,20480);
if(feof(fpsc))
break;
* fpsctemp = * fpsc2;
fpsctemp = fopen(LPCTSTR(m_scfile2),"r");
while(1)
{
// MessageBox("循环开始!");
CString StrSc2(source2);
fgets(source2,10240,fpsctemp);
if(feof(fpsctemp))
break;
// MessageBox("21323131313!");
StrSc2.GetBuffer (10240);
// int totallines=0;
//int lines=0;
// CString temp1,temp2;
// temp1=StrSc.Mid(InvoiceStartNumber,InvoiceEndNumber);
// temp2=StrSc2.Mid(InvoiceStart2Number,InvoiceEnd2Number);
//sprintf(MessageOne,"%s数据内容 %s\n",MessageOne,findRecord);
// MessageBox("进入判断相同");
if(StrSc.Mid(InvoiceStartNumber,InvoiceEndNumber)==StrSc2.Mid(InvoiceStart2Number,InvoiceEnd2Number))
{
// MessageBox("进入find");
sprintf(findRecord,"%s%s",findRecord,source);
fputs(findRecord,fpfind);
// MessageBox("返回循环");
break;
}
// MessageBox("进入判断不相同");
else
{
// MessageBox("进入del");
sprintf(delRecord,"%s%s",delRecord,source);
fputs(delRecord,fpdel);
// MessageBox("返回循环");
}
}
//计算原文件记录条数
sourcelines++;
//处理进度
/////////////////////////////////////////////////
if(ProcessNo<=Processtemp)
{
ProcessBase=ProcessBase-1;
if(ProcessBase==0){
ProcessNo=sourcelines/ProcessNum;
progress->SetPos(ProcessNo);
// progress->SetPos(sourcelines);
progress->StepIt();
ProcessBase=ProcessNum;
}
///////////////////////////////////核心代码,问题出现在运行,不是语法问题///////////////
////////清空临时文件//////////////
//strline.Format("%ld",sourcelines);
// strline2.Format("%ld",source2lines);
}
// StrSc.ReleaseBuffer ();
// StrSc2.ReleaseBuffer ();
////////////////////////////////对于进度条的控制,进度条的控制和源文件有关系/////////////////
int i;
CString strTotalsum;
// progress=(CProgressCtrl *)GetDlgItem(IDC_PROGRESS1);
// progress->SetRange(1,Processtemp);
// progress->SetStep(1);
// progress->SetPos(1);
for(i=1;i<=Processtemp;i++)
{
progress->SetPos(i);
strTotalsum.Format("%d",i);
m_btn_biaoshi.SetWindowText(strTotalsum);
// progress->StepIt();
}
}
fclose(fpfind);
fclose(fpdel);
fclose(fpsctemp);
fclose(fpsc2);
fclose(fpsc);
}
UpdateData(FALSE);
--------------------next---------------------
阅读(1074) | 评论(0) | 转发(0) |