查看单个帖子
旧 2009-04-14, 02:29 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】(access violation reading 0xcccccccc)在线等呢

(access violation reading 0xcccccccc)在线等呢
(access violation reading 0xcccccccc)在线等呢
(access violation reading 0xcccccccc)
acad::errorstatus cmodifyent::changecolor(acdbobjectid entid, adesk::uint16 colorindex)
{
acdbentity *pentity;
// 打开图形数据库中的对象
acdbopenobject(pentity, entid, acdb::kforwrite);
// 修改实体的颜色
pentity->setcolorindex(colorindex);
pentity->close();
return acad::eok;
}这个是在cmodifyent定义的类,然后我在另一个类调用的时候出现这样的问题(在vc中编译是没有问题)
但是在cad里调用的时候就出现问题了,这个是调用函数
cmodifyent::changecolor(lineid, 1);
---------------------------
g:\zuoye\createent\debug\createent.arx arx 命令中发生异常
---------------------------
未处理的异常 c0000005 (access violation reading 0xcccccccc),地址: 3264e28h
---------------------------
确定
---------------------------
acad::errorstatus cmodifyent::changecolor(acdbobjectid entid, adesk::uint16 colorindex)
{
acdbentity *pentity=null; // 指针对象需要初始化
// 打开图形数据库中的对象
acad::errorstatus es=acdbopenobject(pentity, entid, acdb::kforwrite);
// 修改实体的颜色
if(es==acad::eok && pentity!=null) // 确认entid有效且可以写方式打开
{
pentity->setcolorindex(colorindex);
pentity->close();
}
return es;
}
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)