Dlgdata. cpp line 40 asserted failure

Source: Internet
Author: User

An error occurs when running a C ++ program in vs2010:

As soon as I see this, my head is big. The key is F:/DD/vctools/vc7libs/ship/atlmfc/src/mfc/dlgdata. cpp. This path does not exist in my computer. But it is estimated that it is in the installation directory.

I think it is recently updated to vs2010_sp1, but the release package:

En_visual_c ++ _ 2010_sp1_redistributable_package_x86_651767

Not Installed. Try again after installation. An error occurs.

To find dlgdata. cpp, I used the following self-written search tool,

After searching, open the file with a tool, click View> Status Bar on the opened notepad, and then locate the 40 rows:

Finally, I got the rough idea. I searched for the keyword cdataexchange: preparectrl on Google, the first search result,

Http://blog.csdn.net/zipper9527/archive/2009/06/19/4282229.aspx

"I think the reason is that you bind a variable to a control. Later, if you think this control is useless, you can directly Delete the control in the dialog box, the associated code is not deleted ".

The key is that I don't know how many nidcs I use. Later I found many nidcs because I have bound many variables. In this case, drag dlgdata. cpp to the vs2010 environment of the current project, open dlgdata. cpp, set a breakpoint at row 40th, and click the Green run button to quickly reach the breakpoint.

Haha, NIDC found, it is 1008.

Find the corresponding id_edit1.

Then follow

Http://blog.csdn.net/zipper9527/archive/2009/06/19/4282229.aspx

Comment out relevant lines

// Ddx_control (PDX, idc_edit1, m_xxxx );

Comment out idc_edit1 and m_xxxx,

Run again, and no more hitting the breakpoint. Yeah !!!

Cause analysis: a text box control eidt1 was originally set, and then bound to a variable, and then thought it was not good, and replaced the control with ComboBox, then this phenomenon emerged.

Conclusion: before deleting a control, unbind the control variable before deleting the control.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.