Debug Assertion failed! 这是什么错误
请高手帮帮忙,谢谢在编译的出错提示是: 在附件有信息说明(报错信息
报错提示.zip
(91.67 KB)
)Debug Assertion failed!
Program: D:\rgri\bin\test.exe
File:afxcoll.inl
Line:376
CListCtrlPop类 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++) { str=m_strlist[i].GetNext(pos); col_length[i]=max(col_length[i],str.GetLength()); } m_listctrl->SetColumnWidth(i,col_length[i]*10);//LVSCW_AUTOSIZE_USEHEADER } for(k=0;k<m_iColumns;k++) length=length+col_length[k]; m_listctrl->MoveWindow(0,0,length*10+18,this->m_rectShow.Height()-7); m_rectShow.right=length*10+26; delete [] col_length; return temp; } CDlgXSTH 类 bool CDlgXSTH::InitnListTH() { CRect rect_nlist(10,350,700,650); this->GetClientRect(&rect_nlist); rect_nlist.top=150; rect_nlist.left+=10; rect_nlist.right-=10; rect_nlist.bottom=330; this->m_plistTH=new CListXSTH(m_bXsth,this->m_strPh); m_plistTH->Create(WS_CHILD|WS_VISIBLE|LVS_REPORT| WS_BORDER,rect_nlist,this,ID_NEWLISTLSXSDJ); //this->m_plistTH->OnParentMoved(); this->m_plistTH->ModifyStyle(LVS_EDITLABELS, 0L); m_plistTH->ModifyStyle(0L, LVS_REPORT); m_plistTH->ModifyStyle(0L, LVS_SHOWSELALWAYS); m_plistTH->ModifyStyle(0L, LVS_NOSORTHEADER); // m_plistTH->SetBkColor(RGB(0,200,200)); // m_plistTH->SetTextBkColor(RGB(0,200,200)); m_plistTH->ModifyStyle( LVS_OWNERDRAWFIXED,0L); m_plistTH->SetExtendedStyle( LVS_EX_FULLROWSELECT | // LVS_EX_HEADERDRAGDROP | LVS_EX_GRIDLINES | // LVS_EX_ONECLICKACTIVATE | LVS_EX_FLATSB // LVS_EX_UNDERLINEHOT ); CString str; // 1、先产生numTitle列 // m_plistTH->SetItemCount(20); int i=0; m_plistTH->InsertColumn( i, "商品编号" ); m_plistTH->InsertColumn( 1, "商品名称" ); m_plistTH->InsertColumn( 2, "仓库名称" ); m_plistTH->InsertColumn( 4, "数量" ); m_plistTH->InsertColumn( 5, "金额" ); if(this->m_bXsth) { m_plistTH->InsertColumn( 3, "单价" ); } else { m_plistTH->InsertColumn( 3, "进价" ); } // 2、插入1行 m_plistTH->InsertItem(0,""); // 3、调整列宽 RECT rect2; m_plistTH->GetWindowRect(&rect2); int wid = rect2.right - rect2.left; for( i=0; i<6; i++ ) { m_plistTH->SetItemText(0,i,""); m_plistTH->SetColumnWidth( i, wid/6 ); } m_plistTH->SetSubItemCanEdited(0); m_plistTH->SetSubItemCanEdited(1); m_plistTH->SetSubItemCanEdited(2); m_plistTH->SetSubItemCanEdited(3); m_plistTH->SetSubItemCanEdited(4); m_plistTH->SetSubItemCanEdited(5); m_plistTH->Invalidate(false); return true; } bool CListCtrlPop::Create(CWnd* parent) { bool result = CDialog::Create(IDD,parent); this->ShowWindow(SW_HIDE); this->InitListCtrl(); this->GetClientRect(&this->m_rectShow); return true; }还有哪些类,你帮我分析一下