stream2000
Programmer
I'm currently working on a project and i have some problems.
I made my own file type (a simple text file) and the problem appears when I'm trying to load a file. In DEBUG mode it works smoothly but in RELEASE mode I get an error.
This is the sequence :
______________________________________________
void CWallpaperDlg::OnFileLoad()
{
SetCurrentDirectory(m_strCurrDir);
CFileDialog dlg(TRUE);
dlg.m_ofn.lpstrFilter = "Image List Files (*.wps)\0*.WPS\00";
dlg.m_ofn.lpstrTitle = "Open Image List";
if (dlg.DoModal() == IDOK)
{
OnClear();
CFile File;
CFileException fileException;
int iOctetiCititi;
int i;
char szCitit[100] ;
char szFileName2[] = "";
strcpy(szFileName2 , dlg.GetFileName());
char szListFile[300];
for(i=0;i<300;i++)
{
szListFile='0';
}
File.Open(szFileName2 , CFile::modeRead , &fileException);
iOctetiCititi = 1;
int iContor=0;
while (iOctetiCititi > 0 )
{
iOctetiCititi = File.Read(szCitit, 1);
if ((szCitit[0] != 13) && (szCitit[0] != 10))
{
szListFile[iContor] = szCitit[0];
iContor++;
}
if (szCitit[0] == 13)
{
//strcat(szListFile,"\0\0"
;
m_cListControl.InsertString( -1, szListFile);
//Curatare
for(i=0;i<iContor;i++)
{
szListFile=0;
}
iContor = 0;
}
}
File.Close();
}
}
_______________________________________________________
I made my own file type (a simple text file) and the problem appears when I'm trying to load a file. In DEBUG mode it works smoothly but in RELEASE mode I get an error.
This is the sequence :
______________________________________________
void CWallpaperDlg::OnFileLoad()
{
SetCurrentDirectory(m_strCurrDir);
CFileDialog dlg(TRUE);
dlg.m_ofn.lpstrFilter = "Image List Files (*.wps)\0*.WPS\00";
dlg.m_ofn.lpstrTitle = "Open Image List";
if (dlg.DoModal() == IDOK)
{
OnClear();
CFile File;
CFileException fileException;
int iOctetiCititi;
int i;
char szCitit[100] ;
char szFileName2[] = "";
strcpy(szFileName2 , dlg.GetFileName());
char szListFile[300];
for(i=0;i<300;i++)
{
szListFile='0';
}
File.Open(szFileName2 , CFile::modeRead , &fileException);
iOctetiCititi = 1;
int iContor=0;
while (iOctetiCititi > 0 )
{
iOctetiCititi = File.Read(szCitit, 1);
if ((szCitit[0] != 13) && (szCitit[0] != 10))
{
szListFile[iContor] = szCitit[0];
iContor++;
}
if (szCitit[0] == 13)
{
//strcat(szListFile,"\0\0"
m_cListControl.InsertString( -1, szListFile);
//Curatare
for(i=0;i<iContor;i++)
{
szListFile=0;
}
iContor = 0;
}
}
File.Close();
}
}
_______________________________________________________