为什么序列化失败呢?小弟我觉得这段程序没有关问题啊

为什么序列化失败呢?我觉得这段程序没问题啊?
这个函数是写文件。目测是没有太大问题的,而且之前也是很顺利运行的。可是调试了之后,
也不是到时哪里弄错了,文件写不进不说,还弹出这个警告框。求前辈指教。


void CMP3PlayerDlg::OnSave()
{
if(m_strpathname.IsEmpty())
{
CFileDialog dlg(FALSE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
    NULL,NULL);
    dlg.DoModal();
    m_strpathname=dlg.GetPathName();
}
CFile file;
file.Open(m_strpathname,CFile::modeCreate|CFile::modeWrite);
CArchive ar(&file,CArchive::store);
CString songname;
int n=m_musicarray.GetCount();
ar<<n;
for(int i=0;i<n;i++)
{
songname=m_musicarray.GetAt(i);
ar<<songname;
}
file.Close();
issaved=true;
}

为什么序列化失败呢?小弟我觉得这段程序没有关问题啊

还有就是,遇到这种弹出的警告对话框,应该在哪里寻找相关错误信息?
------解决方案--------------------
呵呵,你找到的哪句没贴出来嘛。