简体   繁体   中英

Debug Assertion Failed in mfc140ud.dll

When I am creating a new dialogue and calling DoModel on it. I am getting the following debug assertion.

The code is

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 error is as shown below

在此处输入图片说明

The Assertion is at the debug point as shown in image in dlgcore.cpp file

Assuming that AcceptFile inherits from CDialog, probably you can prevent the debug assertion by the extending the AcceptFile constructor with calling the CDialog constuctor with a lpszTemplateName argument. For example:

class AcceptFile : public CDialog
{
public:
    AcceptFile(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL)
        : CDialog(lpszTemplateName, pParentWnd)
    {
        // your code here
    }

// other stuff
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM