本文整理汇总了C++中msxml2::IXMLDOMNode::get_baseName方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMNode::get_baseName方法的具体用法?C++ IXMLDOMNode::get_baseName怎么用?C++ IXMLDOMNode::get_baseName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类msxml2::IXMLDOMNode
的用法示例。
在下文中一共展示了IXMLDOMNode::get_baseName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ND_hrGetTableValue
HRESULT XMLPaser::ND_hrGetTableValue( LPCTSTR strTable, LPCTSTR strField,
UINT idxRow, TCHAR* pVal )
{
HRESULT hr = E_FAIL;
MSXML2::IXMLDOMNode *pNode = NULL;
long idxColumn = -1;
long lTableChilds = 0;
long lfirstRow = 0;
try
{
pNode = ND_pGetTableNode( strTable );
if ( pNode )
{
MSXML2::IXMLDOMNodeList* pRowNodeList;
pNode->get_childNodes( &pRowNodeList );
if ( pRowNodeList )
{
pRowNodeList->get_length( &lTableChilds );
MSXML2::IXMLDOMNode *pRowNode;
BSTR bstrName;
LPSTR pszName;
for ( long ll = 0; ll < lTableChilds; ll++ )
{
pRowNodeList->get_item( ll, &pRowNode );
pRowNode->get_baseName( &bstrName );
// 처음 Row가 나오는 순간
UnicodeToAnsi( bstrName, &pszName );
if ( stricmp( pszName, _T("Row") ) == 0 )
{
lfirstRow = ll;
CoTaskMemFree( pszName );
::SysFreeString( bstrName );
break;
}
CoTaskMemFree( pszName );
::SysFreeString( bstrName );
}
if ( lfirstRow >= lTableChilds )
{
return ( E_FAIL );
}
pRowNodeList->get_item( lfirstRow, &pRowNode );
if ( pRowNode )
{
MSXML2::IXMLDOMNodeList* pCellNodeList;
pRowNode->get_childNodes( &pCellNodeList );
if ( pCellNodeList )
{
long lCell = 0;
pCellNodeList->get_length( &lCell );
for ( long ll = 0; ll < lCell; ll++ )
{
MSXML2::IXMLDOMNode *pCellNode;
pCellNodeList->get_item( ll, &pCellNode );
if ( pCellNode )
{
MSXML2::IXMLDOMNode *pDataNode;
pCellNode->get_firstChild( &pDataNode );
if ( pDataNode )
{
LPSTR pszColumnName;
pDataNode->get_text( &bstrName );
UnicodeToAnsi( bstrName, &pszColumnName );
if ( stricmp( pszColumnName, strField ) == 0 )
{
idxColumn = ll;
}
CoTaskMemFree( pszColumnName );
::SysFreeString( bstrName );
pDataNode->Release();
}
pCellNode->Release();
}
}
pCellNodeList->Release();
}
pRowNode->Release();
}
pRowNodeList->get_item( idxRow + lfirstRow + 1, &pRowNode );
if ( pRowNode )
{
MSXML2::IXMLDOMNodeList* pCellNodeList;
pRowNode->get_childNodes( &pCellNodeList );
//.........这里部分代码省略.........