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. Assertation error

Assertation error

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingtutorialquestion
5 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.
  • S Offline
    S Offline
    Semion_N
    wrote on last edited by
    #1

    Hello, When I'm running my project, I get an assertation message like you can see on the picture: http://img82.imageshack.us/img82/9623/assertationerroreu6.jpg[^] Here is a piece of code : 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);**//the error is here AfxThrowNotSupportedException(); } } m_idLastControl = nIDC; m_bEditLastControl = FALSE; // not an edit item by default return hWndCtrl; } the line of the errer is bolded. Do anyone know how to fix this problem? Thanking you in advance! SnaidiS(Semion)

    H V 2 Replies Last reply
    0
    • S Semion_N

      Hello, When I'm running my project, I get an assertation message like you can see on the picture: http://img82.imageshack.us/img82/9623/assertationerroreu6.jpg[^] Here is a piece of code : 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);**//the error is here AfxThrowNotSupportedException(); } } m_idLastControl = nIDC; m_bEditLastControl = FALSE; // not an edit item by default return hWndCtrl; } the line of the errer is bolded. Do anyone know how to fix this problem? Thanking you in advance! SnaidiS(Semion)

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      I think pSite is null.Did you saw MSDN: From the MSDN ASSERT tests an expression. If the expression is false, it breaks into the kernel debugger._**


      **_

      whitesky


      S 1 Reply Last reply
      0
      • S Semion_N

        Hello, When I'm running my project, I get an assertation message like you can see on the picture: http://img82.imageshack.us/img82/9623/assertationerroreu6.jpg[^] Here is a piece of code : 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);**//the error is here AfxThrowNotSupportedException(); } } m_idLastControl = nIDC; m_bEditLastControl = FALSE; // not an edit item by default return hWndCtrl; } the line of the errer is bolded. Do anyone know how to fix this problem? Thanking you in advance! SnaidiS(Semion)

        V Offline
        V Offline
        vladfein
        wrote on last edited by
        #3

        Right above the ASSERT, there is an explanation: you call one of the data exchange functions (DDX_... or DDV_...) with an ID of a control that doesn't exist. Most likely, it did exist once, but was later removed from your resource file, and generated code was left behind... ----------------------------- Get trial copy of FeinViewer - an integrated GDI objects viewer for Microsoft Visual Studio .NET 2005 (8.0) Visual C++ Debugger, and other convenience and productivity tools for Microsoft Visual Studio .NET at at www.FeinSoftware.com

        S 1 Reply Last reply
        0
        • H Hamid Taebi

          I think pSite is null.Did you saw MSDN: From the MSDN ASSERT tests an expression. If the expression is false, it breaks into the kernel debugger._**


          **_

          whitesky


          S Offline
          S Offline
          Semion_N
          wrote on last edited by
          #4

          Thank you! SnaidiS(Semion)

          1 Reply Last reply
          0
          • V vladfein

            Right above the ASSERT, there is an explanation: you call one of the data exchange functions (DDX_... or DDV_...) with an ID of a control that doesn't exist. Most likely, it did exist once, but was later removed from your resource file, and generated code was left behind... ----------------------------- Get trial copy of FeinViewer - an integrated GDI objects viewer for Microsoft Visual Studio .NET 2005 (8.0) Visual C++ Debugger, and other convenience and productivity tools for Microsoft Visual Studio .NET at at www.FeinSoftware.com

            S Offline
            S Offline
            Semion_N
            wrote on last edited by
            #5

            Thank you! SnaidiS(Semion)

            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