tractor 发表于 2007-5-22 16:53:00

高手帮忙指点下程序,

<p>ds_name entname;<br/>&nbsp;AcDbObjectId entID;<br/>&nbsp;AcDbEntity *pEnt=NULL;<br/>&nbsp;_variant_t vvhandle;<br/>&nbsp;_bstr_t bstrSql;<br/>&nbsp;CString s1,s2,s3;</p><p>vvhandle=143;//一条线段的句柄<br/>&nbsp;s1 = (LPCTSTR)(_bstr_t)vvhandle;<br/>&nbsp;acdbHandEnt(s1,entname);<br/>&nbsp;&nbsp; &nbsp;acdbGetObjectId(entID,entname);<br/><br/>&nbsp;acdbOpenObject(pEnt,entID,AcDb::kForWrite,true);<br/>&nbsp;<br/>&nbsp;pEnt-&gt;highlight();<br/>&nbsp;pEnt-&gt;close();<br/>&nbsp;&nbsp;&nbsp; AfxMessageBox("结束高亮显示,点击确定");</p><p>一运行这段,autocad就会异常关闭!帮忙指导一下吧,多谢阿!</p>

sieben 发表于 2007-5-23 15:12:00

<p>ads_name CString</p><p>acdbHandEnt函数使用的参数的数据类型是ads_name而不是CString</p>
页: [1]
查看完整版本: 高手帮忙指点下程序,