2011-09-20 96 views
0

訪問計算機時出現訪問衝突錯誤。 錯誤不一致,只能在嘗試訪問大量數據時重現。 我有2900個組件,併爲每個組件調用一個函數。在這個函數中,我正在訪問一個ccompter,而這個應用程序在200,210,2500等隨機位置崩潰。當它崩潰時,位置不固定。在訪問ccomptr指針和應用程序時出現訪問衝突(c系統異常代碼:c0000005)崩潰

這個問題是特定於系統配置如下:內存

這裏 視窗服務器2003 R2 至強CPU,2.66 GHz的 2 GB是我的代碼

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; 
} 
+0

'db_attributes'的價值是什麼? – sharptooth

+0

是否從一個DLLL調用到另一個DLLL? –

+0

1. m_pIEPGraphicData是一個CComPtr ,並將其分配給也是一種CComPtr 類型的pIEPGraphicData。 2. db_attributes是一個DBAttributes類指針。 3.通話不會轉到其他dll通話。 – bitsmax

回答

0

可能性:

  1. GetGraphicData()返回的對象可能不支持IEPGraphicData接口。我希望智能指針賦值能夠產生一個空指針,而不是訪問衝突。

  2. db_attributes對象已從腳下刪除。