本文整理汇总了C++中msxml2::IXMLDOMElementPtr::GetchildNodes方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMElementPtr::GetchildNodes方法的具体用法?C++ IXMLDOMElementPtr::GetchildNodes怎么用?C++ IXMLDOMElementPtr::GetchildNodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMElementPtr
的用法示例。
在下文中一共展示了IXMLDOMElementPtr::GetchildNodes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PickUpGroups
BOOL CIconImgList::PickUpGroups( MSXML2::IXMLDOMElementPtr& piGroup, int& nIndex)
{
MSXML2::IXMLDOMNodeListPtr piGroupList;
piGroupList = piGroup->GetchildNodes();
MSXML2::IXMLDOMElementPtr piNode;
MSXML2::IXMLDOMElementPtr piChild;
int nParent = nIndex;
_bstr_t cBstr;
_variant_t cVariant;
long lCount = piGroupList->Getlength();
for( long lIndex = 0; lIndex < lCount; lIndex++)
{
piNode = piGroupList->Getitem( lIndex);
if( _bstr_t( _T( "GROUP")) == piNode->GetbaseName())
{
cBstr = piNode->getAttribute( _bstr_t( _T( "TITLE")));
cVariant = piNode->getAttribute( _bstr_t( _T( "ENABLE")));
cVariant.ChangeType( VT_BOOL);
m_astGroupData[ nIndex] = ( GROUPDATA*)malloc( sizeof( GROUPDATA) + ( sizeof( TCHAR) * ( cBstr.length() + 1)));
m_astGroupData[ nIndex]->nParent = nParent;
if( 1 <= nIndex)
{
if( FALSE == m_astGroupData[ nParent]->blEnable)
{
cVariant.boolVal = VARIANT_FALSE;
}
}
m_astGroupData[ nIndex]->blEnable = ( VARIANT_FALSE == cVariant.boolVal) ? FALSE : TRUE;
lstrcpy( m_astGroupData[ nIndex]->szName, cBstr);
nIndex++;
PickUpGroups( piNode, nIndex);
}
else if( _bstr_t( _T( "ITEM")) == piNode->GetbaseName())
{
cVariant = piNode->getAttribute( _bstr_t( _T( "REF")));
cVariant.ChangeType( VT_I4);
for( int nIndex = 0; nIndex < m_nEnableCount; nIndex++)
{
if( cVariant.intVal == ( m_astIconStatus[ nIndex].nID + 1))
{
m_astIconStatus[ nIndex].nParent = nParent;
}
}
}
}
return TRUE;
}
示例2: LoadIcons
BOOL CIconImgList::LoadIcons( MSXML2::IXMLDOMDocumentPtr& piDocument)
{
BOOL blResult = FALSE;
MSXML2::IXMLDOMElementPtr piRoot;
piRoot = piDocument->GetdocumentElement();
if( NULL == piRoot)
{
return FALSE;
}
MSXML2::IXMLDOMElementPtr piGroups;
piGroups = piRoot->selectSingleNode( _bstr_t( _T( "GROUPS")));
MSXML2::IXMLDOMElementPtr piIcons;
piIcons = piRoot->selectSingleNode( _bstr_t( _T( "ICONS")));
if( NULL == piIcons)
{
return FALSE;
}
MSXML2::IXMLDOMNodeListPtr piIconsList;
piIconsList = piIcons->GetchildNodes();
if( NULL == piIconsList)
{
return FALSE;
}
long lIconsCount;
lIconsCount = piIconsList->Getlength();
if( 0 >= lIconsCount)
{
return FALSE;
}
m_nCountExtend = lIconsCount;
if( 0 < m_nCountExtend)
{
m_astIconStatus = new ICONSTATUS[ m_nCountExtend];
if( NULL != m_astIconStatus)
{
/*
ZeroMemory( m_astIconStatus, sizeof( ICONSTATUS) * m_nCountExtend);
*/
for( int nIndex = 0; nIndex < m_nCountExtend; nIndex++)
{
m_astIconStatus[ m_nEnableCount].nID = 0;
m_astIconStatus[ m_nEnableCount].blEnable = FALSE;
m_astIconStatus[ m_nEnableCount].nParent = 0;
m_astIconStatus[ m_nEnableCount].nPosition = 0;
m_astIconStatus[ m_nEnableCount].cStrIconName.Empty();
}
int nHeight = ( m_nCountExtend / 10) + ( ( m_nCountExtend % 10) ? 1 : 0);
m_hBmpExtend = ::CreateBitmap( _ICON_WIDTH * 10, _ICON_HEIGHT * nHeight, 1, 1, NULL);
HDC hExtDC = ::CreateCompatibleDC( NULL);
HDC hDefDC = ::CreateCompatibleDC( NULL);
HDC hWorkDC = ::CreateCompatibleDC( NULL);
HBITMAP hOldExtBmp = ( HBITMAP)::SelectObject( hExtDC, m_hBmpExtend);
HBITMAP hOldDefBmp = ( HBITMAP)::SelectObject( hDefDC, m_hBmpDefault);
m_nEnableCount = 0;
CString cStrEntry;
LPBYTE lpabyData;
TCHAR szWork[ 64];
MSXML2::IXMLDOMElementPtr piIcon;
MSXML2::IXMLDOMElementPtr piImage;
MSXML2::IXMLDOMElementPtr piParent;
_variant_t cVariant;
_bstr_t cBstr;
CString strTitle;
for( int nIndex = 0; nIndex < m_nCountExtend; nIndex++)
{
cVariant = VARIANT_TRUE;
if( NULL != piGroups)
{
wsprintf( szWork, _T( "//ITEM[@REF='%d']"), nIndex + 1);
piIcon = piGroups->selectSingleNode( _bstr_t( szWork));
if( NULL != piIcon)
{
cVariant = piIcon->getAttribute( _bstr_t( _T( "ENABLE")));
if( cVariant.vt != VT_NULL)
{
VariantChangeType( &cVariant, &cVariant, 0, VT_BOOL);
}
else
{
cVariant = VARIANT_TRUE;
}
}
}
if( VARIANT_FALSE != cVariant.boolVal)
{
wsprintf( szWork, _T( "//ICON[@ID='%d']"), nIndex + 1);
piIcon = piRoot->selectSingleNode( _bstr_t( szWork));
if( NULL == piIcon)
{
//.........这里部分代码省略.........