Home > Software engineering >  The Debug an Assertion Failed! error
The Debug an Assertion Failed! error

Time:10-11

I'm doing a project, from someone else take over, take charge of a redundant sliding block dialog, I wanted to hide him, but to run after the hidden or can see it, so I just angry to delete it, this is out of the trouble, run time, show the debug an assertion failed error, I ordered a retry later, interrupt the dlgdata. A line of CPP, specific code is as follows:
 HWND CDataExchange: : PrepareCtrl (int nIDC) 
{
ASSERT (nIDC!=0);
ASSERT (nIDC!=1);//not allowed
The HWND hWndCtrl;
COleControlSite * pSite=NULL;
M_pDlgWnd - & gt; GetDlgItem (nIDC, & amp; HWndCtrl);
If (hWndCtrl==NULL)
{
//Could be a windowless OCX
PSite=m_pDlgWnd - & gt; GetOleControlSite (nIDC);
If (pSite==NULL)
{
TRACE (traceAppMsg, 0, "Error: no data exchange control with ID 0 x % 4 x. \ n", nIDC);
ASSERT (FALSE);
AfxThrowNotSupportedException ();
}
}
M_idLastControl=nIDC;
M_bEditLastControl=FALSE;//not an edit item by default

Return hWndCtrl;
}

Interrupt to ASSERT (FALSE); This line,
I also met the debug this error before, but because of wild pointer problem, really don't know how to modify this time, for the great god help!

CodePudding user response:

Hope the great god glad, I really worry, the project main content is done, don't want to delay progress because the interface problem

CodePudding user response:

Problem has been added to 100 points, hope to have a great god can solve my problem!

CodePudding user response:

The call stack, it should be DoDataExchange DDX_Control control went wrong, associated in block

CodePudding user response:

reference zgl7903 reply: 3/f
see the call stack, should be in the DoDataExchange DDX_Control associated controls make a mistake, block

Not oh,,, I dodataexchange ddx_control inside there is no the id of the sliding block,,

CodePudding user response:

IDC_LOAD_ACQ_CONFIG, this is I delete the sliding block id,
And dodataexchange:
 void CGigeCameraDemoDlg: : DoDataExchange (CDataExchange * symbol) 
{
CDialog: : DoDataExchange (symbol);
//{{AFX_DATA_MAP (CGigeCameraDemoDlg)
DDX_Control (symbol, IDC_STATUS m_statusWnd);
DDX_Control (symbol, IDC_VERT_SCROLLBAR m_verticalScr);
DDX_Control (symbol, IDC_HORZ_SCROLLBAR m_horizontalScr);
DDX_Control (symbol, IDC_VIEW_WND m_viewWnd);

DDX_Text (symbol, IDC_FIXTHD single_height);
DDX_Text (symbol, IDC_RGAREA m_rgarea);
//DDX_Text (symbol, IDC_FIXTHD2 m_fixthd2);
//DDX_Text (symbol, IDC_RGAREA2 m_rgarea2);
//DDX_Control (symbol, IDC_MSCOMM1 m_ctrlComm);
DDX_Control (symbol, IDC_GRAB m_ButtenGrab);
DDX_Control (symbol, IDC_FREEZE m_ButtenFreeze);
DDX_Control (symbol, IDC_SHOWPICTURE m_picture);
DDX_Control (symbol, IDC_logopicture HBMP);
DDX_Control (symbol, IDC_STATIC_RESULT m_result);
}

Without this id

CodePudding user response:

Look here on the first floor of a reply

CodePudding user response:

refer to 6th floor dingxz105090 response:
look here on the first floor of the reply

To tell the truth, it may not seem like I feel on the first floor said this problem well, perhaps I was too stupid, don't understand

CodePudding user response:

1, the resource. H delete slider inside the ID of the
2, the corresponding CPP and H file Dialog delete slider ID (should be in the message that block)

CodePudding user response:

You find the first slider ID related code, look at the code was clear to all did what operation does not ~

CodePudding user response:

Search "IDC_LOAD_ACQ_CONFIG
"Delete all
  • Related