大家帮我看看下面代码,那里错了啊!!
编译没问题,但是运行就出错查找字符串的。有一个文本test.txt,内容:哈哈,12,1213,12312,
are,12,12e,t6,
11,22,33,44
CString m_name;
CStdioFile file("test.txt",CFile::modeReadWrite);
while(file.ReadString(m_name))
{
int num=0;
int n_index=0;
int position=0;
CString str1[5];while(m_name.Find(",",position)!=-1)
 {
   n_index=m_name.Find(",",position);
   str1[num++]=m_name.Mid(position,n_index-position);
   position=m_name.Find(",",position);
 }
AfxMessageBox(str1[0]);//这里设置断点进行调试,就是运行到这里就出错的
AfxMessageBox(str1[1]);
AfxMessageBox(str1[2]);
AfxMessageBox(str1[3]);
}