IXMLDOMDocument::get_url
Previous | Next |
IXMLDOMDocument::get_url
The get_url method retrieves the URL for the most recently loaded XML document.
Syntax
HRESULT get_url( BSTR* bstrUrlString );
Parameters
bstrUrlString
[out] Pointer to a BSTR containing the URL from the last successful load. If the document is being built in memory, this method returns NULL.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Remarks
This method retrieves the URL from the last successful load. If the document is being built in memory, this method returns NULL.
The URL retrieved is not updated after saving a document with the save method. To update the URL, reload the document using the load method.
This method is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).
Example Code
The following example retrieves a pointer to an IXMLDOMDocument interface and retrieves the URL of the playlist.
#include "wmsserver.h" #include <atlbase.h> // Includes CComVariant and CComBSTR. // Declare variables. IWMSServer* pServer; IXMLDOMDocument* pPlaylist; HRESULT hr; CComBSTR bstrURL; 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 the URL for the IXMLDOMDocument object // and display it. hr = pPlaylist->get_url(&bstrURL); 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 |