“xxx.exe中的0x7d62159e处未处理的异常:0xC0000005:读取位置0x10008b88时发生访问冲突”是什么原因? 我的程序界面,总是随机不定期的出现上述错误,有时很频繁,有时又很少出现,请问有什么解决方法? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这种BUG最烦人step by step debug 查一下你的动态库在被FreeLibrary之前有没有做好清除工作,或者是否有设置了系统的回调,例如SetTimer或timerSetEvent等等,却没有相应的KillTimer和timerKillEvent。0x7d62159e是ntdll里面的指令,0x10008b88通常是自己写的dll被加载的空间。如果ntdll访问了自己写的dll发生AV,则通常是由于资源释放不彻底或提前释放导致。 我觉得错误一般就定位在这两段程序中,挺简单得了,但就是找不出错误所在,大家帮忙找找吧,谢了!void CIntegrationDlg::OnBnClickedButtonadd(){ // TODO: 在此添加控件通知处理程序代码 //选择打开文件路径 CString strFilter; strFilter = "和擎配置文件 *.hq|*.hq||"; CFileDialog dlg(TRUE, ".hq", NULL, OFN_FILEMUSTEXIST|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST| OFN_ALLOWMULTISELECT, strFilter); // TCHAR *pBuffer = new TCHAR[MAX_PATH * 100];//最多允许100个文件 // dlg.m_ofn.lpstrFile = pBuffer; // dlg.m_ofn.nMaxFile = 100*MAX_PATH; // dlg.m_ofn.lStructSize = 88; if(dlg.DoModal()==IDOK) { POSITION pos = dlg.GetStartPosition(); while(pos != NULL) { CString filepath = dlg.GetNextPathName(pos);// int index = filepath.ReverseFind( '\\' );// CString dbFilename = filepath.Right((int)strlen(filepath)-index-1); int nIndex = 0,flag = 0; while ((nIndex=m_filelist.FindStringExact(nIndex, filepath)) != LB_ERR) { CString info; info.Format("文件\"%s\"已存在于列表中!!!",filepath); AfxMessageBox(info,MB_OK); flag = 1; break; } if (flag == 0) { m_filelist.AddString(filepath); } } int dx=0; CSize sz; CDC* pDC = m_filelist.GetDC(); CString str; for(int j=0;j<m_filelist.GetCount();j++) { m_filelist.GetText(j,str); sz= pDC->GetTextExtent(str); if ( sz.cx > dx) dx = sz.cx; } m_filelist.ReleaseDC(pDC); m_filelist.SetHorizontalExtent(dx); }}void CIntegrationDlg::OnBnClickedButtonbrowse(){ // TODO: 在此添加控件通知处理程序代码 //选择打开文件路径 CString strFilter; strFilter = "和擎配置文件 *.lzx|*.lzx||"; CFileDialog filedlg(FALSE, ".lzx", NULL, OFN_FILEMUSTEXIST|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST, strFilter); if(filedlg.DoModal()==IDOK) { finalfilePath = filedlg.GetPathName(); AfxMessageBox(finalfilePath); finalfileName = filedlg.GetFileName(); GetDlgItem(IDC_EDIT_path)->SetWindowText(finalfilePath); FinalFile = new CFile(finalfilePath,CFile::modeCreate|CFile::modeWrite);//同时已经打开了文件 CArchive at(FinalFile,CArchive::store); at.WriteString("BEGIN-INTERFACE\n"); at.WriteString("END-INTERFACE\n"); at.WriteString( "BEGIN-CONNECT\n" ); at.WriteString( "END-CONNECT\n" ); at.Close(); FinalFile->Close(); } //const char* s = "iios/12DDWDFF@122"; //char buf[20]; //CString asdf; //sscanf( s, "%*[^/]/%[^@]", buf ); //asdf.Format("%s",buf); //AfxMessageBox(asdf); //printf( "%s\n", buf );} 关键是我不知道,是那行出的错,.net根本不给定位的机会,点继续就不停的提示那个错-_-| 再问结束异步WinInet回调函数的问题。。 vs2010 使用CToolBar创建新工具栏时的错误 接收广播UDP 急 QQ状态切换 请教关于spi的一个函数WSCInstallProvider __uuidof作用是什么呀? 怎样获取鼠标右击响应,并返回右击的元素? #pragma message 什么意思 hzwanglw(小兵)请签个名,200分 UNICODE有漏洞吗? 怎么做静态库才行 谁知道“虚拟键码对照表”,哪里能下载!
void CIntegrationDlg::OnBnClickedButtonadd()
{
// TODO: 在此添加控件通知处理程序代码
//选择打开文件路径
CString strFilter;
strFilter = "和擎配置文件 *.hq|*.hq||";
CFileDialog dlg(TRUE, ".hq", NULL, OFN_FILEMUSTEXIST|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST| OFN_ALLOWMULTISELECT, strFilter);
// TCHAR *pBuffer = new TCHAR[MAX_PATH * 100];//最多允许100个文件
// dlg.m_ofn.lpstrFile = pBuffer;
// dlg.m_ofn.nMaxFile = 100*MAX_PATH;
// dlg.m_ofn.lStructSize = 88; if(dlg.DoModal()==IDOK)
{
POSITION pos = dlg.GetStartPosition();
while(pos != NULL)
{
CString filepath = dlg.GetNextPathName(pos);
// int index = filepath.ReverseFind( '\\' );
// CString dbFilename = filepath.Right((int)strlen(filepath)-index-1);
int nIndex = 0,flag = 0;
while ((nIndex=m_filelist.FindStringExact(nIndex, filepath)) != LB_ERR)
{
CString info;
info.Format("文件\"%s\"已存在于列表中!!!",filepath);
AfxMessageBox(info,MB_OK);
flag = 1;
break;
}
if (flag == 0)
{
m_filelist.AddString(filepath);
}
}
int dx=0;
CSize sz;
CDC* pDC = m_filelist.GetDC();
CString str;
for(int j=0;j<m_filelist.GetCount();j++)
{ m_filelist.GetText(j,str);
sz= pDC->GetTextExtent(str);
if ( sz.cx > dx)
dx = sz.cx;
}
m_filelist.ReleaseDC(pDC);
m_filelist.SetHorizontalExtent(dx);
}
}void CIntegrationDlg::OnBnClickedButtonbrowse()
{
// TODO: 在此添加控件通知处理程序代码
//选择打开文件路径
CString strFilter;
strFilter = "和擎配置文件 *.lzx|*.lzx||";
CFileDialog filedlg(FALSE, ".lzx", NULL, OFN_FILEMUSTEXIST|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST, strFilter); if(filedlg.DoModal()==IDOK)
{
finalfilePath = filedlg.GetPathName();
AfxMessageBox(finalfilePath);
finalfileName = filedlg.GetFileName();
GetDlgItem(IDC_EDIT_path)->SetWindowText(finalfilePath);
FinalFile = new CFile(finalfilePath,CFile::modeCreate|CFile::modeWrite);//同时已经打开了文件
CArchive at(FinalFile,CArchive::store);
at.WriteString("BEGIN-INTERFACE\n");
at.WriteString("END-INTERFACE\n");
at.WriteString( "BEGIN-CONNECT\n" );
at.WriteString( "END-CONNECT\n" );
at.Close();
FinalFile->Close();
} //const char* s = "iios/12DDWDFF@122";
//char buf[20];
//CString asdf;
//sscanf( s, "%*[^/]/%[^@]", buf );
//asdf.Format("%s",buf);
//AfxMessageBox(asdf);
//printf( "%s\n", buf );}