0xC0000005: 写入位置 0xcccccccc 时发生访问冲突的疑问
请教一个关于内存访问冲突的问题
程序代码很简单..
=====a.h======
#pragma once
#include "stdafx.h"
#include <afxinet.h>
#include <Wininet.h>
class AccessUrl
{
public:
CWnd *SetWindowServer(CWnd *pWndServer);
CWnd *GethWndServer();
AccessUrl();
~AccessUrl();
private:
CWnd *m_pWndServer;
};
======aaa1Dlg.cpp==========
#include "a.h"
......
......
AccessUrl::AccessUrl()
{
m_pWndServer=NULL;
}
CWnd *AccessUrl::SetWindowServer(CWnd *pWndServer)
{
return m_pWndServer=pWndServer;}
void Caaa1Dlg::OnBnClickedButton1()
{
Caaa1Dlg::ff->SetWindowServer(this);
}
========================
为什么运行后点按钮,直接出错,提示
aaa1.exe 中的 0x00412309 处未处理的异常: 0xC0000005: 写入位置 0xcccccccc 时发生访问冲突
调试信息如下:
“aaa1.exe”: 已加载“C:\Program Files\Netease\POPO\msvcr71.dll”,未加载任何符号。
aaa1.exe 中的 0x00412309 处最可能的异常: 0xC0000005: 写入位置 0xcccccccc 时发生访问冲突
aaa1.exe 中的 0x00412309 处未处理的异常: 0xC0000005: 写入位置 0xcccccccc 时发生访问冲突
明明
AccessUrl::AccessUrl()
{
m_pWndServer=NULL;
}
已经初始化了m_pWndServer
百思不得其解,请各位高人指点一下....