获取错误为“Someone.exe:0xC0000005:访问冲突读取位置0x00000010。” [英] Getting error as "Someone.exe: 0xC0000005: Access violation reading location 0x00000010."

查看:80
本文介绍了获取错误为“Someone.exe:0xC0000005:访问冲突读取位置0x00000010。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我收到一些严重的异常,因为NKDesk.exe中0x0061d796处的未处理异常:0xC0000005:访问冲突读取位置0x00000010。



以下是代码::



标题:

Hi All
I am getting some serious exception as "Unhandled exception at 0x0061d796 in NKDesk.exe: 0xC0000005: Access violation reading location 0x00000010."

Below is the code::

in Header:

CTableInfo* pTIShow;





来源:



in Source:

CColumnInfo*	pTIShow_UH = NULL;
void CMainFrame::SetDatabaseColumnPointers()
{
	// Show table indexes
	pTIShow_UH = &(pTIShow->GetColumn(_T("UH")));	
}




stdAfx.h中的




in stdAfx.h:

struct CTableInfo
{
        CColumnInfo & GetColumn(CString name)
	{
		name.MakeLower();
		CColumnNameMap::const_iterator it = names.find(name);
		if (it != names.end())
			return columns[it->second];
		return *reinterpret_cast<CColumnInfo*>(NULL);
	}
public:
	CString					name;
        typedef std::map<CString, int>		CColumnNameMap;
protected:
	typedef std::vector<CColumnInfo>	CColumnInfoContainer;
	CColumnInfoContainer	                columns;
	CColumnNameMap			        names;
};





首先我认为有一些空指针但是在检查了上述每个语句后都没有对象具有空值。所以我在这里更加困惑。



请帮我解决这个异常。



First i thought that there is some null pointer regarding but after checking each of the statement none of the above object have null value. So I am being more confused here.

Please help me to resolve this exception.

推荐答案

这个基本上是一个NULL指针异常。它的0x10而不是零,因为您使用NULL指针作为指向结构/类的指针,并且您正在尝试访问struct / class中偏移量0x10上的结构/类的成员。仍然是一个NULL指针异常。



该错误在您的代码中的其他位置,而不是您提供的代码段中。在调试器中运行代码并检查this指针的值作为callstack每个级别的第一步。如果你没有找到NULL这个指针,那么继续在别处搜索NULL值。
This is basically a NULL pointer exception. Its 0x10 and not zero because you are using the NULL pointer as a pointer to a struct/class and you are trying to access a member of that struct/class that is on offset 0x10 inside the struct/class. Still it is a NULL pointer "exception".

The bug is somewhere else in your code, not in the snippet you provided. Run the code in a debugger and check out the value of the this pointer as a first step on every level of the callstack. If you don't find a NULL this pointer then continue searching for NULL values elsewhere.


这篇关于获取错误为“Someone.exe:0xC0000005:访问冲突读取位置0x00000010。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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