1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| CString PathName;
CFileDialog FileDlg( FALSE, "txt", NULL, OFN_HIDEREADONLY, "Fichiers txt(*.txt)|*.txt||" );
if( FileDlg.DoModal() == IDOK )
{
PathName = FileDlg.GetPathName();
}
m_nRow=m_grid.GetRows();
int y=0;
ofstream fich(PathName);
int taillefichier=0;
taillefichier=(6*(m_nRow-1));
fich << taillefichier <<endl;
m_nRow=m_grid.GetRows();
m_nCol=m_grid.GetCols();
for (int i=1;i<m_nRow ;i++)
{
for (int j=0;j<m_nCol;j++)
{save=m_grid.GetTextArray(GenID(i,j));
sauvegarde[y]=save;
fich << sauvegarde[y] << " ";
y=y+1;
}
} |
Partager