MAP添加数据, 执行报错.

robert_duan 2009-03-09 09:58:54
.h中定义:
struct st_plugin{
int Ref;
HANDLE Handle;
};

map <char*, st_plugin> m_Plugin;

.cpp中
执行函数:插入数据.

char * szPluginName = "Hello";

st_plugin st_test;
st_test.Handle = this;
st_test.Ref += 1;

m_Plugin[szPluginName] = st_test; //执行到这一步, 程序中断?

//-----------------------------------------------------
提示: SATester.exe 中的 0x00410a0b 处未处理的异常: 0xC0000005: 读取位置 0x00000004 时发生访问冲突
确定-转到:_Nodeptr _Lbound(const key_type& _Keyval) const
{ // find leftmost node not less than _Keyval
_Nodeptr _Pnode = _Root();
_Nodeptr _Wherenode = _Myhead; // end() if search fails

//-------------------------------------------------------
...全文
109 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
robert_duan 2009-03-09
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 csgdseed 的回复:]
st_test.Handle = this;
这句好像有问题
[/Quote]

应该不是这里的问题
st_test.Handle = NULL; 我也试过.
csgdseed 2009-03-09
  • 打赏
  • 举报
回复
st_test.Handle = this;
这句好像有问题

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧