本文整理汇总了C++中TStringList::AddTail方法的典型用法代码示例。如果您正苦于以下问题:C++ TStringList::AddTail方法的具体用法?C++ TStringList::AddTail怎么用?C++ TStringList::AddTail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStringList
的用法示例。
在下文中一共展示了TStringList::AddTail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTargetsFromTargetTree
/**
* get target id paths for all targets from target tree.
*
* @param [in] rtIdMap: id map with id -> id path data
* @see
*/
BOOL CInstanceTree::GetTargetsFromTargetTree(TStringList& listTargets)
{
// get all targets as id paths
SAFEARRAY* parrTargets;
m_pProjectManager->getAllTargetsAsIdPaths(&parrTargets);
BSTR HUGEP *pbstr;
BSTR bstr;
HRESULT hr;
unsigned long i;
// Get a pointer to the elements of the array.
hr = ::SafeArrayAccessData(parrTargets, (void HUGEP**)&pbstr);
if(FAILED(hr))
{
return FALSE;
}
CString strIdPath;
for (i = 0; i < (parrTargets->rgsabound[0]).cElements; i++)
{
bstr = pbstr[i];
strIdPath = (CString)bstr;
listTargets.AddTail(strIdPath);
}
::SafeArrayUnaccessData(parrTargets);
::SafeArrayDestroy(parrTargets);
return TRUE;
}
示例2: UpdateTargets
//.........这里部分代码省略.........
CString strInstAddress;
CString strInstUserAddress;
CString strInstConsoleAddress;
CString strInstAssignedResource;
CString strInstSource;
nodeInstance.GetAttribute(CE_XMLATTR_TEXT, strInstText);
nodeInstance.GetAttribute(CE_XMLATTR_ID, strInstId);
//nodeInstance.GetAttribute(CE_XMLATTR_TYPE, strInstType); // type can't change
nodeInstance.GetAttribute(CE_XMLATTR_ADDR, strInstAddress);
nodeInstance.GetAttribute(CE_XMLATTR_USERADDR, strInstUserAddress);
nodeInstance.GetAttribute(CE_XMLATTR_CONSOLE_ADDR, strInstConsoleAddress);
nodeInstance.GetAttribute(CE_XMLATTR_RESOURCE, strInstAssignedResource);
nodeInstance.GetAttribute(CE_XMLATTR_SOURCE, strInstSource);
if ((strInstText.CompareNoCase(strTText)!=0)
|| (strInstId.CompareNoCase(strTId)!=0)
//|| (strInstType.CompareNoCase(strType)!=0)
|| (strInstAddress.CompareNoCase(strTAddress)!=0)
|| (strInstConsoleAddress.CompareNoCase(strTConsoleAddress)!=0)
|| (strInstAssignedResource.CompareNoCase(strTAssignedResource)!=0)
|| (strInstSource.CompareNoCase(strTSource) != 0))
{
// node has changed -> update nodes
nodeInstance.SetAttribute(CE_XMLATTR_TEXT, strTText);
nodeInstance.SetAttribute(CE_XMLATTR_ID, strTId);
//nodeInstance.SetAttribute(CE_XMLATTR_TYPE, strType);
nodeInstance.SetAttribute(CE_XMLATTR_ADDR, strTAddress);
nodeInstance.SetAttribute(CE_XMLATTR_USERADDR, strTUserAddress);
nodeInstance.SetAttribute(CE_XMLATTR_CONSOLE_ADDR, strTConsoleAddress);
nodeInstance.SetAttribute(CE_XMLATTR_RESOURCE, strTAssignedResource);
nodeInstance.SetAttribute(CE_XMLATTR_SOURCE, strTSource);
listUpdateChanged.AddTail(pInstTargetInfo->strIdPath);
}
}
else // *** new node ***
{
if(!m_domDocument.CreateNode(nodeInstance, CE_XMLTAG_NODE))
{
continue;
}
// set attributes of target instance node
nodeInstance.SetAttribute(CE_XMLATTR_TEXT, strTText);
nodeInstance.SetAttribute(CE_XMLATTR_ID, strTId);
nodeInstance.SetAttribute(CE_XMLATTR_ADDR, strTAddress);
nodeInstance.SetAttribute(CE_XMLATTR_USERADDR, strTUserAddress);
nodeInstance.SetAttribute(CE_XMLATTR_CONSOLE_ADDR, strTConsoleAddress);
nodeInstance.SetAttribute(CE_XMLATTR_RESOURCE, strTAssignedResource);
nodeInstance.SetAttribute(CE_XMLATTR_TARGET_TYPE, strTType);
nodeInstance.SetAttribute(CE_XMLATTR_SOURCE, strTSource);
nodeInstance.SetAttribute(CE_XMLATTR_TYPE, strInstType);
if (!strWaitForTarget.IsEmpty())
{
nodeInstance.SetAttribute(CE_XMLATTR_WAIT_TARGET_CONN, strWaitForTarget);
}
// create new instance info struct
ASSERT(pInstTargetInfo==NULL);
pInstTargetInfo = new TInstanceTargetInfo;
ASSERT(pInstTargetInfo);
if (!pInstTargetInfo)
{