MFC学习笔记之VC++ Debug Assertion Failed! 错误(File: strex.cpp Line: 690)
2015-01-10 20:19
816 查看
转载:http://blog.sina.com.cn/s/blog_8a7012cf0101es10.html
问题(File: strex.cpp Line: 690):
错误描述:在Debug模式下报错,Release模式下正常。
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: D:\Projects\20130906\HK-H英文\Debug\C100A.exe
File: strex.cpp
Line: 690
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
终止(A) 重试(R) 忽略(I)
---------------------------
错误原因:CString设计缺陷。
解决方法:在格式化浮点数时增加临时变量。格式化整数时不存在这个问题。
**********************会报错********************************
CString str;
str.Format("%.3f", 5.6);
str.Format("%-15s", str);
**********************会报错********************************
**********************正常********************************
CString str;
str.Format("%d", 5);
str.Format("%-15s", str);
**********************正常********************************
**********************解决方法********************************
CString str;
CString strTemp;
strTemp.Format("%.3f", 5.6);
str.Format("%-15s", strTemp);
**********************解决方法********************************
官方说明:在
Strex.cpp,CString::Format 与行 690 断言的 BUG
问题(File: strex.cpp Line: 690):
错误描述:在Debug模式下报错,Release模式下正常。
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!
Program: D:\Projects\20130906\HK-H英文\Debug\C100A.exe
File: strex.cpp
Line: 690
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
---------------------------
终止(A) 重试(R) 忽略(I)
---------------------------
错误原因:CString设计缺陷。
解决方法:在格式化浮点数时增加临时变量。格式化整数时不存在这个问题。
**********************会报错********************************
CString str;
str.Format("%.3f", 5.6);
str.Format("%-15s", str);
**********************会报错********************************
**********************正常********************************
CString str;
str.Format("%d", 5);
str.Format("%-15s", str);
**********************正常********************************
**********************解决方法********************************
CString str;
CString strTemp;
strTemp.Format("%.3f", 5.6);
str.Format("%-15s", strTemp);
**********************解决方法********************************
官方说明:在
Strex.cpp,CString::Format 与行 690 断言的 BUG
相关文章推荐
- MFC学习笔记003之调试错误DebugAssertionFailed!File:afx.inl Line:157
- MFC程序出现“Debug Assertion Failed! File:dlgdata.cpp Line: 43 ”错误
- MFC程序出现“Debug Assertion Failed! File:dlgdata.cpp Line: 43 ”错误
- VC错误: debug assertion failed; file dlgdata.cpp; line43
- VC++ Debug Assertion Failed! 错误(File: winmdi.cpp Line: 141)
- 关于 debug assertion failed, file:dlgdata.cpp,line"44 错误收藏
- MFC程序出现“Debug Assertion Failed! File:afx.inl Line:177”错误
- MFC程序出现“Debug Assertion Failed! File:afx.inl Line:177”错误
- 关于 debug assertion failed, file:dlgdata.cpp,line"44 错误
- 关于 debug assertion failed, file:dlgdata.cpp,line"43 错误解析
- VC Debug Assertion Failed File:dlgdata.cpp Line 43
- 调试错误 debug assertion failed; file:dlgdata.cpp; line 43 分析析
- 引用 Debug Assertion Failed!File:wingdi.cpp Line:1120
- Debug Assertion Failed!……File:winocc.cpp Line:345……(Press Retry to debug the application)
- debug assertion failed, file:dlgdata.cpp,line"43
- debug assertion failed, file:dlgdata.cpp,line43
- Debug Assertion Failed! FIle:afxhtml.inl Line 57的错误的解决
- Debug Assertion Failed! File:cmdtarg.cpp Line:52
- debug assertion failed! mfc/winocc.cpp line 381
- 引用 Debug Assertion Failed!File:wingdi.cpp Line:1120