未处理的异常帮助 [英] Unhandled exception help

查看:118
本文介绍了未处理的异常帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用mfc,我有一个程序可以在屏幕上绘制矩形,并在其中放置MIDI音符.一切正常,直到我的int f值达到屏幕上的27个矩形.出现以下错误:

Using mfc, I have a program where I can draw rectangles on screen in which I can put MIDI notes in. THis all works fine until my int f value reaches 27 rectangles on screen. The following error appears:

UserInterface.exe中0x78640a07(mfc90d.dll)处未处理的异常:0xC0000005:访问冲突读取位置0x0001c0d8.

Unhandled exception at 0x78640a07 (mfc90d.dll) in UserInterface.exe: 0xC0000005: Access violation reading location 0x0001c0d8.

并指出:(我已经注释了接下来要执行的行)

And points to this: (I've commented the line to be executed next)

CFrameWnd* CWnd::GetParentFrame() const
{
	if (GetSafeHwnd() == NULL) // no Window attached
	{
		return NULL;
	}

	ASSERT_VALID(this);

	CWnd* pParentWnd = GetParent(); // start with one parent up
	while (pParentWnd != NULL)
	{
		if (pParentWnd->IsFrameWnd()) //This line to be executed next
		{
			return (CFrameWnd*)pParentWnd;
		}
		pParentWnd = pParentWnd->GetParent();
	}
	return NULL;
}

推荐答案

ATIBSITS,

 

基于上述源代码,它来自Wincore.cpp,它是C ++系统定义的文件.我们 相信它应该运作良好.但是,您提到所有代码在int f值达到27之前都可以正常工作.   f是数组或链表的索引吗?我们猜测您可能使用f动态增加了数组或列表的大小,如果是这种情况,则可能会使数组/列表索引超出范围,从而引发异常:访问冲突.  

Based on the above source code, it is from Wincore.cpp which is a C++ system defined file. We believe it suppose to work well. However, you mentioned all your code works fine until the int f value reaches 27.  Is f an index of an array or a linked list? We guess you may increase the size of array or list dynamically using f, if it is the case, you perhaps get array/list index out of bounds which induce the exception: Access Violation.  

要解决此问题,我们确实需要有关整数f和重现问题的详细步骤,以便我们可以在本地进行调查.它是 您不必发送整个项目.我们只需要一个最简单的示例即可重现该问题.您可以从中删除任何机密信息或公司详细信息.

To troubleshoot this issue, we really need the source code about the integer f and the detailed steps to reproduce the problem, so that we can investigate the issue locally. It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

 

欢呼声

李凤丽


这篇关于未处理的异常帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆