开发环境:Win10+VS2010+acad2014
arx的代码:
inline
AcDbObjectId
CAcUiLineTypeComboBox::getOIDSel(int sel)
{
AcDbObjectId oidLT;
CAcUiLTypeRecord* pLTRec =
(CAcUiLTypeRecord*)(GetItemDataPtr(sel));
if (NULL != pLTRec)
oidLT = pLTRec->objectId();
return oidLT;
}
修改的代码:
class CLineTypeComboBox : public CAcUiLineTypeComboBox
{
public:
AcDbObjectId
CLineTypeComboBox::getOIDSel(int sel)
{
AcDbObjectId oidLT;
CAcUiLTypeRecord* pLTRec =
(CAcUiLTypeRecord*)(GetItemDataPtr(sel));
if ( ( NULL != pLTRec ) && ( -1 != (int)pLTRec) )
oidLT = pLTRec->objectId();
return oidLT;
}
AcDbObjectId getOIDCurSel()
{
return getOIDSel(GetCurSel());
}
};