- 积分
- 316
- 明经币
- 个
- 注册时间
- 2005-4-22
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
请看下面代码:
AcDbObjectId CSetTextStyle::settextstyle() { AcDbObjectId recId; AcDbTextStyleTable *pTextStyleTable; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pTextStyleTable,AcDb::kForWrite); if (!pTextStyleTable->has((LPTSTR)(LPCSTR)m_Font)){ AcDbTextStyleTableRecord *pRecord = new AcDbTextStyleTableRecord; pRecord->setFont((LPTSTR)(LPCTSTR)m_Font,m_bold,m_italic,m_charset,m_pitchAndFamily); pRecord->setFileName(m_FileName); pRecord->setBigFontFileName(m_BigFontFileName); pRecord->setTextSize(m_size); pRecord->setXScale(m_xScale); pRecord->setObliquingAngle(m_obliquingAngle); pRecord->setIsShapeFile(m_shape); pRecord->setIsVertical(m_vertical); pTextStyleTable->add(recId,pRecord); pRecord->close(); } pTextStyleTable->close(); return recId; }
或下面代码:AcDbObjectId CSetTextStyle::settextstyle() { AcDbObjectId recId; AcDbTextStyleTable *pTextStyleTable; acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pTextStyleTable,AcDb::kForRead); if (!pTextStyleTable->has((LPTSTR)(LPCSTR)m_Font)){ AcDbTextStyleTableRecord *pRecord = new AcDbTextStyleTableRecord; pRecord->setFont((LPTSTR)(LPCTSTR)m_Font,m_bold,m_italic,m_charset,m_pitchAndFamily); pRecord->setFileName(m_FileName); pRecord->setBigFontFileName(m_BigFontFileName); pRecord->setTextSize(m_size); pRecord->setXScale(m_xScale); pRecord->setObliquingAngle(m_obliquingAngle); pRecord->setIsShapeFile(m_shape); pRecord->setIsVertical(m_vertical); pTextStyleTable->upgradeOpen(); pTextStyleTable->add( recId,pRecord); pRecord->close(); } pTextStyleTable->close(); return recId; } 总归显示错误: dbobji.cpp@5717:eNotOpenForWrite",可是我已经让pTextStyleTable可写了,为什莫慧这样呢,原因何在,请教大家!!!! |
|