ifstream fileList;
fileList.open("bmf.cnt");
char filename[64];
fileList>>filename;
int flg=1;
int cnt = atoi(&filename[0]);
CString lp = dialog.GetFileName();
for(int i=1;i<cnt+1;i++){
fileList>>filename;
if (strcmp(filename,lp) == 0) {
flg = 0;
break;
}
}
fileList.close();
if(flg == 1){
ifstream fileList1;
fileList1.open("bmf.cnt");
ofstream fileList2;
fileList2.open("bmf2.cnt");
fileList1>>filename;
fileList2<<(cnt+1);
for(int i=1;i<cnt+1;i++){
fileList1>>filename;
fileList2<<'/n';
fileList2<<filename;
}
fileList2<<'/n';
fileList2<<lp.GetBuffer(lp.GetLength());
lp.ReleaseBuffer();
fileList1.close();
fileList2.close();
}
std::ifstream input("bmf2.cnt",ios::binary);
std::ofstream output("bmf.cnt",ios::binary);
output << input.rdbuf();
input.close();
output.close();
DeleteFile("bmf2.cnt");