新建文字式样,有问题请教!
请看下面代码:AcDbObjectId CSetTextStyle::settextstyle()<BR>{<BR> AcDbObjectId recId;<BR> AcDbTextStyleTable *pTextStyleTable;<BR> acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pTextStyleTable,AcDb::kForWrite);<BR> if (!pTextStyleTable->has((LPTSTR)(LPCSTR)m_Font)){<BR> AcDbTextStyleTableRecord *pRecord = new AcDbTextStyleTableRecord;<BR> pRecord->setFont((LPTSTR)(LPCTSTR)m_Font,m_bold,m_italic,m_charset,m_pitchAndFamily);<BR> pRecord->setFileName(m_FileName);<BR> pRecord->setBigFontFileName(m_BigFontFileName);<BR> pRecord->setTextSize(m_size);<BR> pRecord->setXScale(m_xScale);<BR> pRecord->setObliquingAngle(m_obliquingAngle);<BR> pRecord->setIsShapeFile(m_shape);<BR> pRecord->setIsVertical(m_vertical);<BR> pTextStyleTable->add(recId,pRecord);<BR> pRecord->close(); <BR> }<BR> pTextStyleTable->close();<BR> return recId;<BR> }
或下面代码:AcDbObjectId CSetTextStyle::settextstyle()<BR>{<BR> AcDbObjectId recId;<BR> AcDbTextStyleTable *pTextStyleTable;<BR> acdbHostApplicationServices()->workingDatabase()->getSymbolTable(pTextStyleTable,AcDb::kForRead);<BR> if (!pTextStyleTable->has((LPTSTR)(LPCSTR)m_Font)){<BR> AcDbTextStyleTableRecord *pRecord = new AcDbTextStyleTableRecord;<BR> pRecord->setFont((LPTSTR)(LPCTSTR)m_Font,m_bold,m_italic,m_charset,m_pitchAndFamily);<BR> pRecord->setFileName(m_FileName);<BR> pRecord->setBigFontFileName(m_BigFontFileName);<BR> pRecord->setTextSize(m_size);<BR> pRecord->setXScale(m_xScale);<BR> pRecord->setObliquingAngle(m_obliquingAngle);<BR> pRecord->setIsShapeFile(m_shape);<BR> pRecord->setIsVertical(m_vertical);<BR> pTextStyleTable->upgradeOpen();<BR> pTextStyleTable->add( recId,pRecord);<BR> pRecord->close();<BR> <BR> }<BR> pTextStyleTable->close();<BR> return recId;<BR> }<BR>总归显示错误: <A href="mailto:dbobji.cpp@5717:eNotOpenForWrite" target="_blank" ><FONT color=#000000>dbobji.cpp@5717:eNotOpenForWrite</FONT></A>",可是我已经让pTextStyleTable可写了,为什莫慧这样呢,原因何在,请教大家!!!! 调试发现原因在pTextStyleTable->add( recId,pRecord);原因何在 应该是你在设置字体过程中的问题导致了无法把实体加入块表,
页:
[1]