访问ccomptr指针时访问冲突(c系统异常代码:c0000005),应用程序崩溃 [英] access violation (c system exception code : c0000005 ) while accessing ccomptr pointer and application got crash
问题描述
你好,
访问计算机时,出现访问冲突错误.
该错误不一致,只能在尝试访问海量数据时再现.
我有2900个组件,每个组件都在调用一个函数.在此功能中,我正在访问ccompter,同时执行此应用程序时会在200、210、2500等随机位置崩溃.崩溃时该位置未固定.
此问题特定于具有以下配置的系统:
Windows Server 2003 R2
至强CPU,2.66 GHz
2 GB的RAM
这是我的代码
Hello,
While accessing a computer I get an access violation error.
The error is not consistent and only reproducible while trying to access a huge data.
I have 2900 components and for each component I am calling a function. In this function I am accessing a ccompter, while doing this application gets crashed at random position like on 200, 210, 2500 etc. The position in not fixed when it crashes.
This issue is specific to the system with following configuration:
Window Server 2003 R2
Xeon CPU , 2.66 ghz
2 GB of RAM
here is my code
XGGraphicAttribute* pAttr = pExtraGraphicInfo->GetAttribute();
if(pAttr)
{
DBAttributes* db_attributes = NULL;
db_attributes = static_cast<DBAttributes*> (pAttr->GetDBAttributes());
CComPtr<IEPGraphicData> pIEPGraphicData;
if(db_attributes)
pIEPGraphicData = db_attributes->GetGraphicData(); // here my app got crashed
}
IEPGraphicData* DBAttributes::GetGraphicData () const
{
return m_pIEPGraphicData;
}
请帮帮我!!!
问候
BitsMax
Please help me !!!
Regards
BitsMax
推荐答案
调用的函数中会发生什么
What happens in the function called by
db_attributes->GetGraphicData();
您应该使用调试器或添加一些自己的调试代码以查看发生了什么.没有任何人无法猜测为什么这会导致访问冲突.
You should use your debugger or add some debug code of your own to see what is going on. There is no way anyone can guess why this causes an access violation without a lot more information.
请追溯GetGraphicData(),并检查一下使其崩溃!
Pls trace the GetGraphicData(), and check wats making it to crash!
这篇关于访问ccomptr指针时访问冲突(c系统异常代码:c0000005),应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!