11.2好郁闷啊!为何不能在mfc例程modeless中的对话框的控件响应函数中新建直线或公
11.2好郁闷啊!为何不能在mfc例程modeless中的对话框的控件响应函数中新建直线或公差操作?想通过对话框实现用户选择公差相关数据,提交完后,我在图纸标出//程序如下所示:
void CSampDialog::OnCancel()
{
//修改一:
CDialog::OnOK();
runIt();
//以下为新建响应函数部分
}
AcDbObjectId createFcf()
{
//AcGePoint3d center(90, 300, 0.0);
//急问:为何添加AcGePoint3d center(90, 300, 0.0);和pLine->setLocation(center);
//设置公差插入的位置,狂报错啊!
//note:1.错误见最后部分
//2.放到ents例子中画公差一点问题也没有
//3.放到mfc的contextmenu例子中也报同样的错啊,注释掉那两句后,没有错误啊!
AcDbFcf *pLine = new AcDbFcf();
pLine->setText("{\\Fgdt;a}%%v0.1%%v%%v%%v%%v");
//pLine->setLocation(center);
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, pLine);
pBlockTableRecord->close();
pLine->close();
return FcfId;
}
void createNewLayer()
{
AcDbLayerTable *pLayerTable;
acdbHostApplicationServices()->workingDatabase()
->getSymbolTable(pLayerTable, AcDb::kForWrite);
AcDbLayerTableRecord *pLayerTableRecord =
new AcDbLayerTableRecord;
pLayerTableRecord->setName("ASDK_MYLAYER");
// Defaults are used for other properties of
// the layer if they are not otherwise specified.
pLayerTable->add(pLayerTableRecord);
pLayerTable->close();
pLayerTableRecord->close();
}
void createGroup(AcDbObjectIdArray& objIds, char* pGroupName)
{
AcDbGroup *pGroup = new AcDbGroup(pGroupName);
for (int i = 0; i < objIds.length(); i++)
{
pGroup->append(objIds);
}
// Put the group in the group dictionary which resides
// in the named object dictionary.
//
AcDbDictionary *pGroupDict;
acdbHostApplicationServices()->workingDatabase()
->getGroupDictionary(pGroupDict, AcDb::kForWrite);
AcDbObjectId pGroupId;
pGroupDict->setAt(pGroupName, pGroup, pGroupId);
pGroupDict->close();
pGroup->close();
}
void runIt()
{
createNewLayer();
AcDbObjectIdArray idArr;
idArr.append(createFcf());
createGroup(idArr, "ASDK_TEST_GROUP");
}
//Linking...
SampDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall AcGePoint3d::AcGePoint3d(double,double,double)" (__imp_??0AcGePoint3d@@QAE@NNN@Z)
.\modeless.arx : fatal error LNK1120: 1 unresolved externals
Error executing link.exe. lilin,goldlenshin...............,都能出书编大程序的人了,快帮我解答啊! AcGePoint3d::AcGePoint3d(double,double,double)" (__imp_??0AcGePoint3d@@QAE@NNN@Z)
是类型定义错误吗?怎么办啦? AcGePoint3d::AcGePoint3d(double,double,double)" (__imp_??0AcGePoint3d@@QAE@NNN@Z)
是类型定义错误吗?怎么办啦? 也应该是没有加入它LIB文件吧!试一试,应该是那样的 是的啊!问题已经全部搞定了,哈哈哈
lilin,你好可爱啊! 呵呵,对了。YY,你对DBX是不是很熟悉呀!我现在正在读关于DBX的书呢?不过是英文板的,特别难理解, ObjectDBX allows you to write separate executables for the user-interface (UI) and database (DB) portions of your application.
是做ui还是db呢?我先学的vc,对纯ado数据库熟一点
我正打算学com组件 我将程序做成可复用组件,然后搭积木形式组装一个形位公差应用系统,底层是按照GPS规范做的数据库。不知你要做什么呢?
什么时候把我的程序传给你?帮我看看,怎么样? lilin,你最近上哪去了?
页:
[1]
2