请帮忙,做不出就没有工作了!Debug Assertion Failed!错误.
在看别人的程序,一运行就出现assertion错误。
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: F:\地址库\src\RDAddrFilter\Debug\RDAddrFilter.exe
File: winbtn.cpp
Line: 107
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
终止(A) 重试(R) 忽略(I)
---------------------------
我在程序中写了几个messagebox,执行到messagebox("0","0",MB_OK);之后就出错。我点了忽略之后可以继续运行,但是执行到messagebox("","",MB_OK)后,会出现Runtime error!错误,程序就退出了。程序代码如下:
void CRDAddrFilterView::OnInitialUpdate()
{
MessageBox("0","0",MB_OK);
CFormView::OnInitialUpdate();
MessageBox("1","1",MB_OK);
GetParentFrame()->RecalcLayout();
MessageBox("00","00",MB_OK);
ResizeParentToFit();
MessageBox("2","2",MB_OK);
CRect rect;
m_lvAddr.GetClientRect(&rect);
int nColWidth = (int)(rect.Width() / 11);
MessageBox("3","3",MB_OK);
//初始化
m_lvAddr.InsertColumn(0, "代码", LVCFMT_LEFT, nColWidth);
m_lvAddr.InsertColumn(2, "地址", LVCFMT_LEFT, nColWidth*4);
m_lvAddr.InsertColumn(3, "z-code", LVCFMT_LEFT, nColWidth);
m_lvAddr.InsertColumn(4, "投递段", LVCFMT_LEFT, nColWidth);
m_lvAddr.InsertColumn(5, "标准地址", LVCFMT_LEFT, rect.Width() - nColWidth * 7);
m_lvAddr.InsertColumn(6, "AddrID", LVCFMT_LEFT, 0);
MessageBox("","",MB_OK);
m_btnRetri.LoadBitmaps(IDB_BtnUp, IDB_BtnDown);
//m_DzsConn.Open("postaddr", "msz", "aaa111"); //建立数据库连接
//m_filter.OpenDzsDb("postaddr", "msz", "aaa111");
//2005-03-21yang add
m_DzsConn.Open("ora9","yhy","yhy");
m_filter.OpenDzsDb("ora9", "yhy", "yhy");
m_filter.LoadAddr();
ListStation();
}
我对vc也不熟悉,让我来看这个程序,然后改。大家帮忙啊,不然就得自己主动辞职了。