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