这是什么原因?
我的程序中有如下一个函数:
BOOL CShowCourseDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CMajorRecordset* pMajorSet = new CMajorRecordset( &((CMySysApp *)AfxGetApp())->m_db );
if( pMajorSet == NULL )
{
MessageBox( "分配内存错误!", "智能组卷系统", MB_OK | MB_ICONWARNING );
return FALSE;
}
pMajorSet->Open();
while( !pMajorSet->IsEOF() )
{
AddString( &m_Major, pMajorSet->m_major_name);
pMajorSet->MoveNext();
}
pMajorSet->Close();
delete pMajorSet;
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
程序有错误,运行后,弹出错误提示框,Debug Assertion Failed!
跟踪执行了下,错误出现在红色标记的那条语句中,这是什么原因造成的呢?
知道的回答下!
谢了!