When I am iterating through "m_itFileBuffer" stringlist container, I get an exception while fetching the value from the iterator.This line of code works most of the times but only some time it gives exception.In my code I am setting "m_itFileBuffer" iterator to different values. the part of the code is given below
StringList m_listFileBuffer; //this contains list of CString`s, I read from file and insert into this.
StringList::iterator m_itFileBuffer;
....
....
....
....
....
{
bool notEmpty = (m_itFileBuffer != m_MylistFileBuffer.end());
if (notEmpty)
{
m_strLine = static_cast<CString>(*m_itFileBuffer);//Here i get exception
++m_itFileBuffer;
}
}
Below is exception which i get in output window:
Severity: Critical Error (10 - 'System Crit.'), Returncode: 0x80040835, Error No.: 0 (access violation)
Description: C system exception code: C0000005
Any help, why i am getting this exception? Also, How can we reset the iterator?