调试时断言调试失败 [英] Debug assertion failed occurs while debugging
本文介绍了调试时断言调试失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
,,
虽然编译即时通讯没有收到任何错误,但调试时却出现调试断言失败"的消息...我不知道如何解决它,,,请帮助我
Hi,,,
while compiling im not getting any error but while debugging "debugging assertion failed" is coming ... i do no how to solve it ,,, pls help me
CButton::~CButton()
{
DestroyWindow();
}
// Helper for radio buttons
int CWnd::GetCheckedRadioButton(int nIDFirstButton, int nIDLastButton)
{
for (int nID = nIDFirstButton; nID <= nIDLastButton; nID++)
{
if (IsDlgButtonChecked(nID))
return nID; // id that matched
}
return 0; // invalid ID
}
// Derived class is responsible for implementing all of these handlers
// for owner/self draw controls
void CButton::DrawItem(LPDRAWITEMSTRUCT)
{
the prob occurs here
const CString& CString::operator=(LPCTSTR lpsz)
{
ASSERT(lpsz == NULL || AfxIsValidString(lpsz));
return TRUE;
}
BOOL CButton::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam,
LRESULT* pResult)
<pre lang="cs">this is my call stack ,, i dono whats the problem.. if im silly ,, please forgive me ,,, pls guide me
CButton::DrawItem(tagDRAWITEMSTRUCT * 0x0012f6fc) line 72 + 25 bytes
CButton::OnChildNotify(unsigned int 43, unsigned int 1002, long 1242876, long * 0x00000000) line 84
CWnd::SendChildNotifyLastMsg(long * 0x00000000) line 2683
CWnd::ReflectLastMsg(HWND__ * 0x00840a22, long * 0x00000000) line 2721
CWnd::OnDrawItem(int 1002, tagDRAWITEMSTRUCT * 0x0012f6fc) line 1156 + 14 bytes
CWnd::OnWndMsg(unsigned int 43, unsigned int 1002, long 1242876, long * 0x0012f51c) line 1930
CWnd::WindowProc(unsigned int 43, unsigned int 1002, long 1242876) line 1585 + 30 bytes
AfxCallWndProc(CWnd * 0x0012fd98 {CComboTestDlg hWnd=???}, HWND__ * 0x001202ec, unsigned int 43, unsigned int 1002, long 1242876) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x001202ec, unsigned int 43, unsigned int 1002, long 1242876) line 368
AfxWndProcBase(HWND__ * 0x001202ec, unsigned int 43, unsigned int 1002, long 1242876) line 220 + 21 bytes
USER32! 77d48709()
USER32! 77d4d297()
USER32! 77d4b743()
USER32! 77d4b7ab()
USER32! 77d605d0()
USER32! 77d761c6()
USER32! 77d5922c()
USER32! 77d5887a()
USER32! 77d48709()
USER32! 77d487eb()
USER32! 77d4c00e()
USER32! 77d4e366()
CWnd::DefWindowProcA(unsigned int 15, unsigned int 0, long 0) line 1000 + 32 bytes
CWnd::WindowProc(unsigned int 15, unsigned int 0, long 0) line 1586 + 26 bytes
AfxCallWndProc(CWnd * 0x0012fe38 {CButton hWnd=0x00840a22}, HWND__ * 0x00840a22, unsigned int 15, unsigned int 0, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x00840a22, unsigned int 15, unsigned int 0, long 0) line 368
AfxWndProcBase(HWND__ * 0x00840a22, unsigned int 15, unsigned int 0, long 0) line 220 + 21 bytes
USER32! 77d48709()
USER32! 77d487eb()
USER32! 77d4b368()
USER32! 77d4b3b4()
NTDLL! 7c90e473()
USER32! 77d62719()
USER32! 77d6ec20()
USER32! 77d5fd5c()
CWnd::CreateDlgIndirect(const DLGTEMPLATE * 0x00419890, CWnd * 0x00000000 {CWnd hWnd=???}, HINSTANCE__ * 0x00400000) line 327 + 36 bytes
CDialog::DoModal() line 528 + 32 bytes
CComboTestApp::InitInstance() line 58 + 11 bytes
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141eff, int 1) line 39 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141eff, int 1) line 30
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c816fe7()
感谢
thanks
推荐答案
您好Degorio,
DrawItem()中的问题,当所有者绘制的按钮的外观已更改时,框架会调用此函数
为什么要使用CString :: operator =(LpCSTR Lpsz),如果要设置按钮的标题,请使用此
Hi Degorio,
The Problem in your DrawItem(), This function is Called by the framework when a visual aspect of an owner-drawn button has changed
Why are you using CString::operator=(LpCSTR Lpsz), If you want to set caption of button then use this
::DrawText(lpDrawItemStruct->hDC, strText, strText.GetLength(),
&lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
检查此http://msdn.microsoft.com/en-us/library/y0k9f0a4(VS.80).aspx
Check this http://msdn.microsoft.com/en-us/library/y0k9f0a4(VS.80).aspx
这篇关于调试时断言调试失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文