Hello,
I have a function, to read and print XDATA from Object:
// This function calls the selectObject() function to allow
// the user to pick an object; then it accesses the xdata of
// the object and sends the list to the printList() function
// that lists the restype and resval values.
void C_XDATA::ReadXdata(ACHAR sAppName[255], AcDbObjectId pObjID, ads_name adsNewObj)
{
// Get the xdata for the application name.
struct resbuf *pRb;
AcDbObject* pObj;
acdbGetObjectId(pObjID, adsNewObj);
if (acdbOpenObject(pObj, pObjID, AcDb::kForWrite) == Acad::eOk)
{
pRb = pObj->xData(sAppName);
if (pRb != NULL) {
// Print the existing xdata if any is present.
// Notice that there is no -3 group, as there is in
// LISP. This is ONLY the xdata, so
// the -3 xdata-start marker isn't needed.
// WHAT HERE ??
acutPrintf(_T("\XDATA is ok!\n"));
acutRelRb(pRb);
} else {
acutPrintf(_T("\nNo xdata for this appname"));
}
}
pObj->close();
}
Also I have declared in header file:
struct MY_XDATA
{
CString sXdataName;
CString sXdataValue;
};
and:
CList<MY_XDATA, MY_XDATA> m_LstXdata;
CList<MY_XDATA, MY_XDATA>* m_pLstXdata;
Can someone tell me what I should do to get the list with all XDATA?
regards
The source code for the ArxDbg sample contains code for displaying xdata.