首页上一页 1 下一页尾页 1 条记录 1/1页
运行出错提示:Debug Assertion failed!
发表在C语言图书答疑
2015-01-15
是否精华
是
否
版块置顶:
是
否
这是超级学堂-----项目开发课堂----销售管理
编译报错提示: 附件有详细的出错信息
调试时在这一行出错:m_poplist->SelectStringList(6,this->m_pstrlistThYp)
如果不要这行,程序就可以,但是会出现下面的情况
bool CListXSTH::Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
{
bool b=CBaseList::Create(dwStyle,rect,pParentWnd,nID);
m_poplist->SelectStringList(6,this->m_pstrlistThYp);//找到SelectStringList对应函数据
return b;
}
我找到相应的这个函数SelectStringList,如下,调试到这两行出错,
this->m_listctrl->InsertColumn(i,m_strlist[i].GetHead());-编译到这里提示下面的出错
col_length[i]=max(col_length[i],m_strlist[i].GetHead().GetLength());
代码如下:
CStringList * CListCtrlPop::SelectStringList(int number, CStringList *newstringlist)
{
if(number<0)
{
MessageBox("stringlists.number<0");
return NULL;
}
ASSERT(newstringlist!=NULL);
CStringList* temp=m_strlist;
m_iColumns=number;
this->m_strlist=newstringlist;
this->ClearListAllColumn(); //将上次显示的数据删除;
int length=0; //记录总长度
CString str;
int* col_length=new int[m_iColumns]; //记录每列最长的长度
for(int k=0;k<m_iColumns;k++)
col_length[k]=8;
for(int i=0;i<m_iColumns;i++)
{
this->m_listctrl->InsertColumn(i,m_strlist[i].GetHead());-编译到这里提示下面的出错
col_length[i]=max(col_length[i],m_strlist[i].GetHead().GetLength());
POSITION pos=m_strlist[i].FindIndex(1);
for(int j=1;pos!=NULL;j++)
………………………
}
在调试出错中点击“重试”的出错提示
First-chance exception in al.exe (MFC42D.DLL): 0xC0000005: Access Violation.
First-chance exception in al.exe (MFC42D.DLL): 0xC0000005: Access Violation.
Unhandled exception in al.exe(MFC42D.DLL):0Xc0000005:AccessViolation
运行出错提示
Debug Assertion failed!
Program: D:\rgri\bin\test.exe
File:afxcoll.inl
Line:376
For information on how your program can cause an assertion failure,see the Visual C++ documentation on asserts.
Loaded 'C:\Program Files\Common Files\System\ado\msadrh15.dll', no matching symbolic
Loaded 'C:\Program Files\Common Files\System\ado\msadrh15.dll', no matching symbolic information found.
编译报错提示: 附件有详细的出错信息
调试时在这一行出错:m_poplist->SelectStringList(6,this->m_pstrlistThYp)
如果不要这行,程序就可以,但是会出现下面的情况
bool CListXSTH::Create(DWORD dwStyle, const RECT &rect, CWnd *pParentWnd, UINT nID)
{
bool b=CBaseList::Create(dwStyle,rect,pParentWnd,nID);
m_poplist->SelectStringList(6,this->m_pstrlistThYp);//找到SelectStringList对应函数据
return b;
}
我找到相应的这个函数SelectStringList,如下,调试到这两行出错,
this->m_listctrl->InsertColumn(i,m_strlist[i].GetHead());-编译到这里提示下面的出错
col_length[i]=max(col_length[i],m_strlist[i].GetHead().GetLength());
代码如下:
CStringList * CListCtrlPop::SelectStringList(int number, CStringList *newstringlist)
{
if(number<0)
{
MessageBox("stringlists.number<0");
return NULL;
}
ASSERT(newstringlist!=NULL);
CStringList* temp=m_strlist;
m_iColumns=number;
this->m_strlist=newstringlist;
this->ClearListAllColumn(); //将上次显示的数据删除;
int length=0; //记录总长度
CString str;
int* col_length=new int[m_iColumns]; //记录每列最长的长度
for(int k=0;k<m_iColumns;k++)
col_length[k]=8;
for(int i=0;i<m_iColumns;i++)
{
this->m_listctrl->InsertColumn(i,m_strlist[i].GetHead());-编译到这里提示下面的出错
col_length[i]=max(col_length[i],m_strlist[i].GetHead().GetLength());
POSITION pos=m_strlist[i].FindIndex(1);
for(int j=1;pos!=NULL;j++)
………………………
}
在调试出错中点击“重试”的出错提示
First-chance exception in al.exe (MFC42D.DLL): 0xC0000005: Access Violation.
First-chance exception in al.exe (MFC42D.DLL): 0xC0000005: Access Violation.
Unhandled exception in al.exe(MFC42D.DLL):0Xc0000005:AccessViolation
运行出错提示
Debug Assertion failed!
Program: D:\rgri\bin\test.exe
File:afxcoll.inl
Line:376
For information on how your program can cause an assertion failure,see the Visual C++ documentation on asserts.
Loaded 'C:\Program Files\Common Files\System\ado\msadrh15.dll', no matching symbolic
Loaded 'C:\Program Files\Common Files\System\ado\msadrh15.dll', no matching symbolic information found.