程序以前没有问题。后来设置断点,调试其它问题的时候。
在没有出现问题的位置也弹出了debug assert错误。程序代码:
void CTestApp::ReadConfig()
{
//读取系统的配置文件
CString strPath;
    char lpszPathName[MAX_PATH];
char buf[MAX_PATH];
memset(lpszPathName, 0x0, sizeof(lpszPathName));
::GetModuleFileName(::AfxGetInstanceHandle(), lpszPathName, MAX_PATH);
    
strPath=lpszPathName;  //---------------------这句出现错误提示。在debug模式下有 release下正常
int nPos=strPath.ReverseFind('\\');
strPath=strPath.Left(nPos+1);
}
请问是什么原因,我怀疑无意之间修改了设置。以前也没有出现这个错误。