Исходный код
//---------------------------------------------------------
// Выводит список типов атрибутов
//---------------------------------------------------------
// get attribute definitions collection
CComPtr<ITDMSAttributeDefs> pAttrDefs;
CheckError(pApp->get_AttributeDefs(&pAttrDefs));
// show information for each attribute definition in the collection
printf("%-20s %-5s %-20s\n", "SysName", "Type", "Description");
long lCount;
CheckError(pAttrDefs->get_Count(&lCount));
for (long i = 0; i < lCount; i++)
{
// get attribute definition
CComPtr<ITDMSAttributeDef> pAttrDef;
VARIANT varItem;
varItem.vt = VT_I4;
varItem.lVal = i;
CheckError(pAttrDefs->get_Item(varItem, &pAttrDef));
// print information
TDMSDataType type;
BSTR bsSysName, bsDescription;
CheckError(pAttrDef->get_SysName(&bsSysName));
CheckError(pAttrDef->get_Description(&bsDescription));
CheckError(pAttrDef->get_Type(&type));
printf("%-20s %-5d %-20s\n", CSW2A(bsSysName), type, CSW2A(bsDescription));
SysFreeString(bsSysName);
SysFreeString(bsDescription);
}