各位大哥,斑竹!救救我的毕业设计!!!
本帖最后由 作者 于 2004-5-18 17:13:23 编辑 <br /><br /> 这是我在ARX下编的程序,目的是在AUTOCAD中由用户选择明细栏对角上的两点,然后显示出明细栏中的文本。但是,编译无误后,在ARX中运行,选择完两个点后,便弹出对话框:未处理的异常c000005(Access violation reading 0xf28abd),地址:77FCB84DH。这到底是怎么回事?各位,这是我的毕业设计,过几天就要交差了。我很认真的改了几天,但是还是不行。事关毕业,请帮帮忙看看,给点意见!!!我刚才试了一下。程序运行到第一个acedlength()就停止了.
经过测试,程序到了acutPrintf(tent1),便出错,而且会导致CAD自动关机
大家,帮帮忙啊!斑竹,帮帮忙!麻烦大家了
struct resbuf *entitem(struct resbuf *rchain,int gcode)
{ <BR> while((rchain!=NULL)&&(rchain->restype!=gcode))<BR> rchain=rchain->rbnext;<BR> return rchain;<BR>}
void skyextraextra()<BR>{<BR> // TODO: Implement the command<BR>ads_point pt1,pt2,ori,ter,insert;<BR>ads_name s1,set,s2;<BR>struct resbuf eb1,eb2,*list1,*tent1,*list2,*tent2;<BR>char sbuf1,sbuf2;<BR>long num1,num2,m;<BR>double y,x,*a,*b,n;<BR>int tx,ty,i,k,N,p1,p2,d,stat;<BR>if((stat=acedGetPoint(NULL,"please pick up the first point\n",pt1))!=RTNORM)//<BR> acutPrintf("failed in picking the first point\n");<BR>if((stat=acedGetPoint(NULL,"please pick up the second point\n",pt2))!=RTNORM)//<BR> acutPrintf("failed in picking the second point\n");<BR>eb1.restype=0;<BR>strcpy(sbuf1,"LINE");<BR>eb1.resval.rstring=sbuf1;<BR>eb1.rbnext=NULL;<BR>acedSSGet("w",pt1,pt2,&eb1,s1);<BR>if(acedSSLength(s1,&num1)!=RTNORM)<BR> return ;<BR>a=x;<BR>b=y;<BR>for(m=0;m<num1-1;m++)<BR> {<BR> if(acedSSName(s1,m,set)!=RTNORM)<BR> return ;<BR> list1=acdbEntGet(set);<BR> tent1=entitem(list1,10);<BR> ori=tent1->resval.rpoint;<BR> ori=tent1->resval.rpoint;<BR> tent1=entitem(list1,11);<BR> ter=tent1->resval.rpoint;<BR> ter=tent1->resval.rpoint;<BR> if(ori=ter)<BR> {<BR> *a=ori;<BR> a++;<BR> tx++;<BR> }<BR> else<BR> {<BR> *b=ori;<BR> b++;<BR> ty++;<BR> }<BR> }<BR>acutRelRb(list1);<BR>acutRelRb(tent1);<BR>acedSSFree(s1);<BR>for(i=0;i<tx-1;i++)<BR> <BR> for(k=0;k<tx-1;k++)<BR> <BR> if(x<x)<BR> {<BR> n=x;<BR> x=n;<BR> x=x;<BR> }<BR> <BR>for(i=0;i<ty-1;i++)<BR> <BR> for(k=0;k<ty-1;k++)<BR> <BR> if(y<y)<BR> {<BR> n=y;<BR> y=n;<BR> y=y;<BR> }<BR>N=(tx-1)*(ty-1);<BR>char s;<BR>char w;<BR>eb2.restype=0;<BR>strcpy(sbuf2,"TEXT");<BR>eb2.resval.rstring=sbuf1;<BR>eb2.rbnext=NULL;<BR>acedSSGet("w",pt1,pt2,&eb2,s2);<BR>if(acedSSLength(s2,&num2)!=RTNORM)<BR> return ;
for(m=0;m<num2-1;m++)<BR> {<BR> if(acedSSName(s2,m,set)!=RTNORM)<BR> return ;<BR> list2=acdbEntGet(set);<BR> tent2=entitem(list2,1);<BR> strcpy(w,tent2->resval.rstring);<BR> tent2=entitem(list2,10);<BR> insert=tent2->resval.rpoint;<BR> insert=tent2->resval.rpoint;<BR> for(i=0;i<tx-1;i++)<BR> {<BR> if((x<insert)&&(x>=insert))<BR> p1=i;<BR> break;<BR> }<BR> for(i=0;i<ty-1;i++)<BR> {<BR> if((y<insert)&&(y>=insert))<BR> p2=i;<BR> break;<BR> }<BR> d=(tx-1)*p2+p1;<BR> strcpy(s,w);<BR> acutRelRb(list2);<BR> acutRelRb(tent2);<BR> acedSSFree(s2);<BR> }<BR>for(i=0;i<tx-1;i++)
{<BR> acutPrintf("%s ",s);<BR> if(i%(ty-1)==0)<BR> acutPrintf("/n");<BR>}<BR> }
页:
[1]