1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| FILE *st = NULL;
st = fopen(tcFile, "r");
// fopen_s(&st,tcFile,"r");
if(st == NULL)
return;
char tcLecture[2000];
int iPos;
CString tcInsert;
CString tcFile1;
for(;;) {
int iRet = fscanf_s(st,"%[^\n]",tcLecture);
if(iRet == EOF)
break;
iLg = strlen(tcLecture);
iLg--;
// dernier caractere = anti slash
iPos = 0;
for(int k = 0;k != iLg;k++) {
if(tcLecture[k] == '\\')
iPos = k;
}
tcFile1.Format("%s",tcLecture + iPos);
tcInsert = tcRepOri;
tcInsert += tcFile1;
m_ctlListeInfo.AddString(tcInsert);
iRet = fscanf_s(st,"%1c",tcLecture);
if(iRet == EOF)
break;
} |
Partager