首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

读取位置 0x00000020 时发生访问冲突?解决办法

2012-05-08 
读取位置 0x00000020 时发生访问冲突??for(int i0 iRcEdit_RowCount i++){for(int j0 jRcEdit_Colu

读取位置 0x00000020 时发生访问冲突??
for(int i=0; i<RcEdit_RowCount; i++)
{
for(int j=0; j<RcEdit_ColumnCount; j++)
{
CString str = cstrRcContent_MultiKey[SEditPos.DispStartIndex +i][j];
CEdit* pEdit = (CEdit*)GetDlgItem(RcEditIDTable[i][j]);
pEdit->SetWindowText(str);
UpdateData(false);
}
}



for(int j=0; j<SEditPos.EditSize; j++)
{
SEditPos.CheckedEdit[j] = SEditPos.CheckedRc[j+SEditPos.DispStartIndex];
CButton* hCheck =(CButton*)GetDlgItem(RcCheckTable[j]);
if(SEditPos.CheckedEdit[j] == 1)
{
if(hCheck->GetCheck() == 0)
{
hCheck->SetCheck(1);
}
}
else
{
if(hCheck->GetCheck() == 0)
{
hCheck->SetCheck(0);
}
}

}

执行上述代码时发生了这样的错误 :CheckTool.exe 中的 0x787aec6c (mfc90d.dll) 处未处理的异常: 0xC0000005: 读取位置 0x00000020 时发生访问冲突。

错误发生地址是:
AFXWIN_INLINE int CButton::GetCheck() const
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, BM_GETCHECK, 0, 0); }


请问这是怎么回事?
谢谢啦!

[解决办法]
看看是不是指针没有取到值
[解决办法]
windows 什么根本不可以读取 0x00000020 地址的内存,肯定是有指针没有赋值好

热点排行