本文整理汇总了C++中msxml2::IXMLDOMElementPtr::Gettext方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMElementPtr::Gettext方法的具体用法?C++ IXMLDOMElementPtr::Gettext怎么用?C++ IXMLDOMElementPtr::Gettext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMElementPtr
的用法示例。
在下文中一共展示了IXMLDOMElementPtr::Gettext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadIcons
//.........这里部分代码省略.........
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)
{
continue;
}
cVariant = piIcon->getAttribute( _bstr_t( _T( "TITLE")));
if( cVariant.vt != VT_NULL)
{
strTitle = cVariant;
}
else
{
strTitle = _T( "NoTitle");
}
piImage = piIcon->selectSingleNode( _bstr_t( _T( "IMAGE")));
if( NULL == piImage)
{
continue;
}
cBstr = piImage->Gettext();
int nSize = Base64Decode( NULL, 0, cBstr);
lpabyData = new BYTE [ nSize];
Base64Decode( lpabyData, nSize, cBstr);
HBITMAP hWork = ::CreateBitmap( _ICON_WIDTH, _ICON_HEIGHT, 1, 1, lpabyData);
delete [] lpabyData;
HBITMAP hOldWorkBmp = ( HBITMAP)::SelectObject( hWorkDC, hWork);
::BitBlt( hExtDC, ( nIndex % 10) * _ICON_WIDTH, ( nIndex / 10) * _ICON_HEIGHT, _ICON_WIDTH, _ICON_HEIGHT, hWorkDC, 0, 0, SRCCOPY);
::SelectObject( hWorkDC, hOldWorkBmp);
::DeleteObject( hWork);
m_astIconStatus[ m_nEnableCount].nID = nIndex;
m_astIconStatus[ m_nEnableCount].blEnable = TRUE;
m_astIconStatus[ m_nEnableCount].cStrIconName = strTitle;
m_nEnableCount++;
continue;
}
::BitBlt( hExtDC, ( nIndex % 10) * _ICON_WIDTH, ( nIndex / 10) * _ICON_HEIGHT, _ICON_WIDTH, _ICON_HEIGHT, hDefDC, ( COUNT_DEFAULTICON) * _ICON_WIDTH, 0, SRCCOPY);
}
::SelectObject( hExtDC, hOldExtBmp);
::SelectObject( hDefDC, hOldDefBmp);
::DeleteDC( hExtDC);
::DeleteDC( hDefDC);
::DeleteDC( hWorkDC);
m_astIconStatus4Menu = new ICONSTATUS*[ m_nEnableCount];
if( m_astIconStatus4Menu)
{
for( int nIndex = 0; nIndex < m_nEnableCount; nIndex++)
{
m_astIconStatus4Menu[ nIndex] = &m_astIconStatus[ nIndex];
}
qsort( m_astIconStatus4Menu, m_nEnableCount, sizeof( ICONSTATUS*), IconCompare);
blResult = TRUE;
}
}
}
return blResult;
}