Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MFC  - debug assertion failed error

Posted on 2007-03-19
8
Medium Priority
?
2,661 Views
Last Modified: 2013-11-26
Hello,
My MFC project was working ok. I made a change to a line of code and it then started giving me a debug assertion failed error! It points to the ASSERT ( FALSE) line of  this funtion in dlgData.cpp
HWND CDataExchange::PrepareCtrl(int nIDC)
{
      ASSERT(nIDC != 0);
      ASSERT(nIDC != -1); // not allowed
      HWND hWndCtrl;
   COleControlSite* pSite = NULL;
      m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);
      if (hWndCtrl == NULL)
      {
        // Could be a windowless OCX
        pSite = m_pDlgWnd->GetOleControlSite(nIDC);
        if (pSite == NULL)
        {
               TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC);
               ASSERT(FALSE);
               AfxThrowNotSupportedException();
        }
      }
      m_idLastControl = nIDC;
      m_bEditLastControl = FALSE; // not an edit item by default

   return hWndCtrl;
}


Does anyone know what would cause this error and what should I do to get rid of it!?

Thanks
-D
0
Comment
Question by:indacrypt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 71

Accepted Solution

by:
Qlemo earned 1000 total points
ID: 18751574
The corresonding control is not existing (anymore), maybe you renamed the resource ID. This method is called when you create (or display?) your dialog, for all controls having a member variable assigned. All such controls are enumerated in DDX_... macros.
Have a look on the resource ID in this method, and what that correspnds to.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 18754419
What was the line of code you changed?
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 18754714
... the most important question, this is ...
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 1000 total points
ID: 18754736
Look at where the ASSERT(FALSE)  line is in the code - it *could* be something completely different to what your comment suggested.
0
 

Author Comment

by:indacrypt
ID: 18755573
Hi Andy...can u pls explain what you meant by "Look at where the ASSERT(FALSE)  line is in the code -"....Im not able to find that line anywhere in the code other than i nthe place pointed to b ythe debugger....
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 18755591
comment meant for Qlemo.  His comment is likely to be correct but..

indacrypt - what line of code did you change?  Then we would know if Qlemo has got it right or not.
0
 

Author Comment

by:indacrypt
ID: 18755624
ok i see wht you meant....i followed the IDC number from the ASSERT line and found there are two controls by that number. I have to figureout which one hass the problem now I guess. Thanks!
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 18755770
I don't think the resource editor will allow two controls with the same ID on the same dialog (apart from the special IDC_STATIC that is).
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question