jslinzx 发表于 2012-10-16 10:19:56

调试出现 非静态成员函数非法调用

ads_real bl;
if(acedGetReal(("\n请输入比例"),&bl) != RTNORM)
{
return;
}
ads_point pt; //定义点起点类型
acedGetPoint(NULL,"\n_确定标高位置:",pt);//鼠标确定起点
double zg,x;
zg=bl*0.0025;//字高
x=tan(30*3.1415/180)*zg;
AcGePoint2d pt1(pt,pt);
AcGePoint2d pt2(pt-x,pt+zg);
AcGePoint2d pt3(pt+x,pt+zg);
AcGePoint2d pt4(pt,pt);
AcGePoint2dArray points;//定义组
points.append(pt1);//附加起点到组
points.append(pt2);//附加终点到组
points.append(pt3);//附加终点到组
points.append(pt4);//附加终点到组
double width=0;//确定线宽为0
double width1=0;//确定线宽为0
int numVertices = points.length();
AcDbPolyline *pPoly = new AcDbPolyline(numVertices);
for (int i = 0; i < numVertices; i++)
{
pPoly->addVertexAt(i, points.at(i), 0, width, width1);
}
sjk(pPoly);
//文字
AcGePoint3d ptInsert(pt+x,pt,0);//确定文字位置坐标(将AcGePoint2d转为AcGePoint3d)
char fmtval;
acdbRToS(pt,2,2,fmtval);
const char*text=("%s",fmtval);//确定文字内容为多段线编号
AcDbObjectId style = AcDbObjectId::kNull;//设置默认文字样式
double height=zg;//设置字高
double rotation=0;//设置字体旋转高度
AcDbText *pText = new AcDbText(ptInsert,text, style, height,rotation);
sjk(pText);
}


void sjk(AcDbEntity *pEnt)
{
// 获得指向块表的指针
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()
->getBlockTable(pBlockTable, AcDb::kForRead);
// 获得指向特定的块表记录(模型空间)的指针
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,
AcDb::kForWrite);
// 将对象添加到块表记录中
AcDbObjectId EntId;
pBlockTableRecord->appendAcDbEntity(EntId, pEnt);
// 关闭图形数据库的各种对象
pBlockTable->close();
pBlockTableRecord->close();
pEnt->close();

}
} ;

我的带码 是在ARX2002编译成功,在ARX2004调试出现   非静态成员函数非法调用


jslinzx 发表于 2012-10-16 10:33:48

jslinzx 发表于 2012-10-17 10:08:27

已经解决一下在void sjk(AcDbEntity *pEnt)前面加个virtual

virtual   void sjk(AcDbEntity *pEnt)



页: [1]
查看完整版本: 调试出现 非静态成员函数非法调用