马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
下面这段程序编译通过,但在CAD运行时出错,显示“Unhandled Excepton c0000005(Access Violation Writing 0x78656e24)at Address 7800DDD3H",请各位帮忙解决,先谢谢了。
void f()
{
acedCommand(RTSTR,"layer",RTSTR,"m",RTSTR,"ASSIST",RTSTR,"",0);
acedCommand(RTSTR,"layer",RTSTR,"m",RTSTR,"JMD",RTSTR,"",0);
acedCommand(RTSTR,"linetype",RTSTR,"s",RTSTR,"continuous",RTSTR,"",0);
acedCommand(RTSTR,"plinewid",RTSTR,"0",0);
struct resbuf *eb1=NULL,*eb2=NULL;
int rc;
ads_point p1,p2,p3,p4,p5;
ads_name ent;
acedGetPoint(NULL,"\n第一点",p1);
acedGetPoint(p1,"\n第二点",p2);
acedCommand(RTSTR,"linetype",RTSTR,"s",RTSTR,"X5",RTSTR,"",0);
acedCommand(RTSTR,"Line",RTPOINT,p1,RTPOINT,p2,RTSTR,"",0);
acedGetPoint(NULL,"\n对面一点",p3);
rc=acedGetPoint(NULL,"\n对面另一点(回车默认两边平行)",p4);
if(rc==RTNORM)
{
acedCommand(RTSTR,"Line",RTPOINT,p1,RTPOINT,p2,RTSTR,"",0);
acedCommand(RTSTR,"Line",RTPOINT,p3,RTPOINT,p4,RTSTR,"",0);
acedCommand(RTSTR,"linetype",RTSTR,"s",RTSTR,"continuous",RTSTR,"",0);
acedCommand(RTSTR,"Line",RTPOINT,p1,RTPOINT,p3,RTSTR,"",0);
acedCommand(RTSTR,"Line",RTPOINT,p2,RTPOINT,p4,RTSTR,"",0);
}
if(rc==RTNONE)
{
acedCommand(RTSTR,"offset",RTSTR,"t",RTPOINT,p2,RTPOINT,p3,RTSTR,"",0);
acdbEntLast(ent);
eb1=acdbEntGet(ent);
for(eb2=eb1;eb2!=NULL;eb1=eb2->rbnext)
{
if(eb2->restype==0)
if(strcmp(eb2->resval.rstring,"LINE")!=0)
acutRelRb(eb1);
if(eb2->restype==10)
ads_point_set(eb2->resval.rpoint,p4);
if(eb2->restype==11)
ads_point_set(eb2->resval.rpoint,p5);
acutRelRb(eb1);
}
acedCommand(RTSTR,"linetype",RTSTR,"s",RTSTR,"continuous",RTSTR,"",0);
acedCommand(RTSTR,"Line",RTPOINT,p1,RTPOINT,p5,RTSTR,"",0);
acedCommand(RTSTR,"Line",RTPOINT,p2,RTPOINT,p4,RTSTR,"",0);
}
acedCommand(RTSTR,"layer",RTSTR,"s",RTSTR,"0",RTSTR,"",0);
} |