- 积分
- 1423
- 明经币
- 个
- 注册时间
- 2003-8-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
1.菜单响应函数onCommand
void defaultContext::onCommand(Adesk::UInt32 cmdIndex)
{AcDbObjectId createLine();}
//不能AcDbObjectId createLine();这样函数声明?还是其他.....?
//程序执行时为何不跳转到2所列的函数体内?
2.紧接着在同一cpp文件里定义函数createLine的操作——/画一直线(例程)
AcDbObjectId createLine()
{
acutPrintf("ssssssssss");
AcGePoint3d start(200,200,0);
AcGePoint3d end(400,200,0);
AcDbLine *pfcf=new AcDbLine(start,end);
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pBlockTable,AcDb::kForRead);
AcDbBlockTableRecord *pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);
pBlockTable->close();
AcDbObjectId fcfId;
pBlockTableRecord->appendAcDbEntity(fcfId,pfcf);
pBlockTableRecord->close();
pfcf->close();
return fcfId;
}
3.报错
Linking...
Creating library Debug/contextmenu.lib and object Debug/contextmenu.exp
defaultarx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall AcGePoint3d::AcGePoint3d(double,double,double)" (__imp_??0AcGePoint3d@@QAE@NNN@Z)
Debug/contextmenu.arx : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...
contextmenu.arx - 2 error(s), 0 warning(s)
4.我都糊涂了,vc不可以在某个函数体内再调用自定义函数? |
|