vc基于对话程序
善古 2010-07-08 01:47:30 请大家帮忙,谢谢!
程序运行后出现以下错误提示:
Debug Assertion Failed!
Program: C:\EditState\Debug\EditState.exe
File: 122
For information on how your program can cause an assertion
failure,see the viausal C++ documentation on asserts.
(Press Retry to debug the application)
设断点,运行,发现出错的代码位置是: structState.cstrName = cstrTemp;
structState是一个结构体.里边有CString数组,有包含其它结构体变量.
我把前一段代码注释了,被我注释的代码是:
GetDlgItem(IDC_EDIT_ID)->GetWindowText(cstrTemp);//Id
iTemp = _tcstoul(cstrTemp,0,16);
structState.iId = iTemp;
注释之后,运行能通过(structState.cstrName = cstrTemp;)这条赋值语句了,
但是后面又出错,而且还又是在 CString赋值时出错.不知是什么原因,
谢谢大家帮忙回答.