当我创建一个新对话并在其上调用DoModel时。我得到以下调试断言。
代码是
if (m_pWatchDogDialog->WatchDogServer().CurrentUserStatus() == CServerLink::AWAY)
{
CString msg("Requested user is away");
m_pWatchDogDialog->WatchDogServer().SendUserMessage(m_UserKey, msg);
}
else
{
AcceptFile *dlg = new AcceptFile();
dlg->DoModal(); // error is throwing up here
}
错误如下所示
The Assertion is at the debug point as shown in image in dlgcore.cpp file
答案 0 :(得分:0)
假设AcceptFile继承自CDialog,可能可以通过使用lpszTemplateName参数调用CDialog构造函数来扩展AcceptFile构造函数来阻止调试断言。例如:
class AcceptFile : public CDialog
{
public:
AcceptFile(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL)
: CDialog(lpszTemplateName, pParentWnd)
{
// your code here
}
// other stuff
};