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.