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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Debug assert error while using DoModal() ?? please help

Debug assert error while using DoModal() ?? please help

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++debuggingquestionlearning
12 Posts 3 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.
  • N Offline
    N Offline
    Neels
    wrote on last edited by
    #1

    Hi here is my code CDedJed d(this); //passes through constructor and member functions as well d.Domodal(); // goes into the windows files wincore.cpp dlgcore.cpp dbgrpt.cpp gives out debug assert error at the following lcation ->!::PeekMessage(pMsg, NULL, NULL, NULL, PM_NOREMOVE) -> VERIFY(RunModalLoop(dwFlags) == m_nModalResult); -> domodal(); FYI: resource IDs which are loading properly..checked with resource.h help on this regard Neel

    D 1 Reply Last reply
    0
    • N Neels

      Hi here is my code CDedJed d(this); //passes through constructor and member functions as well d.Domodal(); // goes into the windows files wincore.cpp dlgcore.cpp dbgrpt.cpp gives out debug assert error at the following lcation ->!::PeekMessage(pMsg, NULL, NULL, NULL, PM_NOREMOVE) -> VERIFY(RunModalLoop(dwFlags) == m_nModalResult); -> domodal(); FYI: resource IDs which are loading properly..checked with resource.h help on this regard Neel

      D Offline
      D Offline
      Don Box
      wrote on last edited by
      #2

      Debug more into the RunModalLoop(dwFlags) function.

      Come online at:- jubinc@skype

      N 1 Reply Last reply
      0
      • D Don Box

        Debug more into the RunModalLoop(dwFlags) function.

        Come online at:- jubinc@skype

        N Offline
        N Offline
        Neels
        wrote on last edited by
        #3

        thanks for ur reply i use gtalk, got no skype setup/accnt. iam online urneel@gmail.com FYI: This error occur only in debug mode but not in release mode. here is debug details 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(); // here i end up with debug assert error else return AfxInternalPumpMessage(); } regards Neel

        D 1 Reply Last reply
        0
        • N Neels

          thanks for ur reply i use gtalk, got no skype setup/accnt. iam online urneel@gmail.com FYI: This error occur only in debug mode but not in release mode. here is debug details 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(); // here i end up with debug assert error else return AfxInternalPumpMessage(); } regards Neel

          D Offline
          D Offline
          Don Box
          wrote on last edited by
          #4

          Could u write the declaration of the class CDedJed?

          Come online at:- jubinc@skype

          N 1 Reply Last reply
          0
          • D Don Box

            Could u write the declaration of the class CDedJed?

            Come online at:- jubinc@skype

            N Offline
            N Offline
            Neels
            wrote on last edited by
            #5

            CDed.h file ----------------- class CDedJed : public CDialog { // Construction public: CDedJed(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CDedJed) enum { IDD = IDD_DED_JED_DLG }; //}}AFX_DATA // Overrides //{{AFX_VIRTUAL(CDedJed) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL public: void XX(); void YY(); public: int m_TT; // Implementation protected: // Generated message map functions //{{AFX_MSG(CDedJed) virtual void OnOK(); virtual BOOL OnInitDialog(); afx_msg void OnWindowPosChanged(LPWINDOWPOS lpWndPos); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; #endif // !defined(AFX_DELETEJED_H__20D49F0D_8F35_4A61_A493_1F332F85A293__INCLUDED_) CDedJed.cpp file ------------ ///////////////////////////////////////////////////////////////////////////// // CDedJed dialog CDedJed::CDedJed(CWnd* pParent /*=NULL*/) : CDialog(CDedJed::IDD, pParent) { //{{AFX_DATA_INIT(CDedJed) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CDedJed::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDedJed) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDedJed, CDialog) //{{AFX_MSG_MAP(CDedJed) ON_WM_WINDOWPOSCHANGED() //}}AFX_MSG_MAP END_MESSAGE_MAP()

            D 1 Reply Last reply
            0
            • N Neels

              CDed.h file ----------------- class CDedJed : public CDialog { // Construction public: CDedJed(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CDedJed) enum { IDD = IDD_DED_JED_DLG }; //}}AFX_DATA // Overrides //{{AFX_VIRTUAL(CDedJed) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL public: void XX(); void YY(); public: int m_TT; // Implementation protected: // Generated message map functions //{{AFX_MSG(CDedJed) virtual void OnOK(); virtual BOOL OnInitDialog(); afx_msg void OnWindowPosChanged(LPWINDOWPOS lpWndPos); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; #endif // !defined(AFX_DELETEJED_H__20D49F0D_8F35_4A61_A493_1F332F85A293__INCLUDED_) CDedJed.cpp file ------------ ///////////////////////////////////////////////////////////////////////////// // CDedJed dialog CDedJed::CDedJed(CWnd* pParent /*=NULL*/) : CDialog(CDedJed::IDD, pParent) { //{{AFX_DATA_INIT(CDedJed) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CDedJed::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDedJed) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDedJed, CDialog) //{{AFX_MSG_MAP(CDedJed) ON_WM_WINDOWPOSCHANGED() //}}AFX_MSG_MAP END_MESSAGE_MAP()

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              Comment out OnWindowPosChanged(). What happens in OnInitDialog()?

              "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              N 1 Reply Last reply
              0
              • D David Crow

                Comment out OnWindowPosChanged(). What happens in OnInitDialog()?

                "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                N Offline
                N Offline
                Neels
                wrote on last edited by
                #7

                I removed windowpos function , Oninit function has local variables initialization nothing other than that. FYI: I found all reource IDs have been duplicated from other workspace to current work space and trying to display the dialog. could this be a probelm ?

                D 1 Reply Last reply
                0
                • N Neels

                  I removed windowpos function , Oninit function has local variables initialization nothing other than that. FYI: I found all reource IDs have been duplicated from other workspace to current work space and trying to display the dialog. could this be a probelm ?

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  Neels wrote:

                  Oninit function has local variables initialization nothing other than that.

                  What does it look like?

                  Neels wrote:

                  could this be a probelm ?

                  I suspected that until you showed that DoDataExchange() was empty.

                  "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  N 2 Replies Last reply
                  0
                  • D David Crow

                    Neels wrote:

                    Oninit function has local variables initialization nothing other than that.

                    What does it look like?

                    Neels wrote:

                    could this be a probelm ?

                    I suspected that until you showed that DoDataExchange() was empty.

                    "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                    "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                    N Offline
                    N Offline
                    Neels
                    wrote on last edited by
                    #9

                    No resource is not causing the problem... what could be the case which asserts in debug but no in release??? my work fully stopped with this bug. :((

                    D 1 Reply Last reply
                    0
                    • D David Crow

                      Neels wrote:

                      Oninit function has local variables initialization nothing other than that.

                      What does it look like?

                      Neels wrote:

                      could this be a probelm ?

                      I suspected that until you showed that DoDataExchange() was empty.

                      "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                      N Offline
                      N Offline
                      Neels
                      wrote on last edited by
                      #10

                      No...... resource is not causing the problem... what could be the case which asserts in debug but no in release??? my work fully stopped with this bug. :((

                      N 1 Reply Last reply
                      0
                      • N Neels

                        No...... resource is not causing the problem... what could be the case which asserts in debug but no in release??? my work fully stopped with this bug. :((

                        N Offline
                        N Offline
                        Neels
                        wrote on last edited by
                        #11

                        when i press retry option it gives the follwing message: Unhandled exception at 0x1b97d783 (mfc71d.dll) in graf.exe: User breakpoint.

                        1 Reply Last reply
                        0
                        • N Neels

                          No resource is not causing the problem... what could be the case which asserts in debug but no in release??? my work fully stopped with this bug. :((

                          D Offline
                          D Offline
                          David Crow
                          wrote on last edited by
                          #12

                          Neels wrote:

                          what could be the case which asserts in debug but no in release???

                          Assertions do not exist in Release mode.

                          "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

                          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                          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