Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Debug Assertion Failed

Debug Assertion Failed

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebugging
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Davitor
    wrote on last edited by
    #1

    Hi all, please help on debug assert error while using domodal(). CDeleteJed d(this); d.DoModal(); when i debug i found assert as followed

    VERIFY(RunModalLoop(dwFlags) == m_nModalResult);
    ASSERT(ContinueModal());
    // pump message, but quit on WM_QUIT
    if (!AfxPumpMessage()) {
    AfxPostQuitMessage(0);
    return -1;
    }

    =>

    BOOL AFXAPI AfxPumpMessage()
    {
    CWinThread *pThread = AfxGetThread();
    if( pThread )
    return pThread->PumpMessage();
    else
    return AfxInternalPumpMessage();
    }

    debug assertion failed . please help Thanks in adv.

    S 1 Reply Last reply
    0
    • D Davitor

      Hi all, please help on debug assert error while using domodal(). CDeleteJed d(this); d.DoModal(); when i debug i found assert as followed

      VERIFY(RunModalLoop(dwFlags) == m_nModalResult);
      ASSERT(ContinueModal());
      // pump message, but quit on WM_QUIT
      if (!AfxPumpMessage()) {
      AfxPostQuitMessage(0);
      return -1;
      }

      =>

      BOOL AFXAPI AfxPumpMessage()
      {
      CWinThread *pThread = AfxGetThread();
      if( pThread )
      return pThread->PumpMessage();
      else
      return AfxInternalPumpMessage();
      }

      debug assertion failed . please help Thanks in adv.

      S Offline
      S Offline
      sujeet
      wrote on last edited by
      #2

      I think the problem is in this line. CDeleteJed d(this); Dont pass "this" to the constructor. Just check it. It should work fine. Thanks, Sujeet

      D 1 Reply Last reply
      0
      • S sujeet

        I think the problem is in this line. CDeleteJed d(this); Dont pass "this" to the constructor. Just check it. It should work fine. Thanks, Sujeet

        D Offline
        D Offline
        Davitor
        wrote on last edited by
        #3

        thanks for reply.I use without "this" key but result is same..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups