Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IXMLDOMElement::get_tagName
The get_tagName method retrieves the element name.
Syntax
HRESULT get_tagName( BSTR* bstrTagName );
Parameters
bstrTagName
[out] Pointer to a BSTR containing the element's name.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Remarks
This method retrieves the string that represents the element's name.
Example Code
The following example retrieves the name of the root element.
#include "wmsserver.h"
#include <atlbase.h> // Includes CComVariant and CComBSTR.
// Declare variables.
IWMSServer* pServer;
IXMLDOMDocument* pPlaylist;
IXMLDOMElement* pXMLElement;
HRESULT hr;
CComBSTR bstrName;
CComVariant varFile;
VARIANT_BOOL bIsSuccessful;
// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer, NULL, CLSCTX_ALL,
IID_IWMSServer, (void**)&pServer);
if (FAILED(hr)) goto EXIT;
// Create the playlist object.
hr = pServer->CreatePlaylist(&pPlaylist);
// Load a sample playlist file.
varFile = "c:\\wmpub\\wmroot\\simple.wsx";
hr = pPlaylist->load(varFile, &bIsSuccessful);
if (FAILED(hr)) goto EXIT;
if (bIsSuccessful)
{
// Retrieve a pointer to the IXMLDOMElement interface.
hr = pPlaylist->get_documentElement(&pXMLElement);
if (FAILED(hr)) goto EXIT;
// Retrieve and display the tag name of
// the root element.
hr = pXMLElement->get_tagName(&bstrName);
if (FAILED(hr)) goto EXIT;
}
EXIT:
// TODO: Release temporary COM objects and uninitialize COM.
Requirements
Header: wmsserver.h.
Library: WMSServerTypeLib.dll.
Platform: Windows Server 2003 family, Windows Server 2008 family.
See Also
| Previous | Next |