【ORD C++】XAttribute问题

My_elementRef 是当前model中选中的参考文件的元素,写XAttribute失败了,返回值是-105。但是如果将参考文件合并到主文件,就会写入成功。请问是什么原因呢?

ElementRefP My_elementRef = mdlDisplayPath_getElem(path, mdlDisplayPath_getCursorIndex((DisplayPathP)path));
ElementID elID = My_elementRef->GetElementId();
EditElementHandle eeh(elID, ACTIVEMODEL); //添加attribute的元素
...
...
...
XAttributeHandlerId xAttHandlerId(234, 567);

UInt32 xAttId = 101;

XAttributeHandle xAttHandle(eeh.GetElementRef(), xAttHandlerId, xAttId);
StatusInt iRet = -1;
if (xAttHandle.m_node.m_xattr == NULL)
{
//直接存
iRet = ITxnManager::GetCurrentTxn().AddXAttribute(eeh.GetElementRef(), xAttHandlerId, xAttId, pdata, size);
// eeh.ScheduleWriteXAttribute(xAttHandlerId, xAttId, size, pdata);
}

Parents Reply Children
No Data