小弟在开发中,今天不知道为什么无法进行断点调试?无论断点在哪里,都会出现:
Debug Assertion Failed!
File:afxtempl.h
Line:254
For information on how your program can cause an assertion
failure,see the Visual C++ documnetation on asserts. (Press Retry to debug the application)请问是什么原因,在线等待!!!
Debug Assertion Failed!
File:afxtempl.h
Line:254
For information on how your program can cause an assertion
failure,see the Visual C++ documnetation on asserts. (Press Retry to debug the application)请问是什么原因,在线等待!!!
AFX_INLINE TYPE CArray<TYPE, ARG_TYPE>::GetAt(int nIndex) const
{ ASSERT(nIndex >= 0 && nIndex < m_nSize);//Line 254
return m_pData[nIndex]; }说明你的下标没有合法的范围内。
回复phoenix96_2000(eXMe),那里没有出错呀,不论我把断点放在哪里,都会出错.
关键是我每次"忽略"后,都可以执行下一步,但是,再执行,又弹出刚才的错误信息,急死我了.
如果在initInstance中的AfxEnableControlContainer();上加,也会出同样的错误.
回复DentistryDoctor(My heart will fly,in the sky.):我怎么找到到底在哪里出界了,因为不论我把断点加在哪里,都报同样的错误.
回复happyparrot(为何我买彩票从来不中奖?没钱怎么办阿?);直接运行是可以的
call stack:
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00133632, int 1) line 27
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 77e88989()
程序:
extern "C" int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
// call shared/exported WinMain
return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
中出错
检查一下工程的debug设置
不知道你是不是正好也是这样的问题
我把全局数组都放在全局类中,并在全局类构造函数中初始化,发现大大减少出错次数.
以前每步执行都会报错,现在只是在第一个断点处出错,再次感谢大家!!!!.这个断点不论加在何处,即使全局类的构造函数中,也会出错,请问为什么?我现在有三个全局类,发现第一,三个全局类的构造函数都没有出错,只是第二个会出错.