banner art

Previous Next


The get_implementation method retrieves a pointer to an IXMLDOMImplementation interface for the document.


  HRESULT get_implementation(
 IXMLDOMImplementation** ppImpl



[out] Pointer to a pointer to an IXMLDOMImplementation interface for this document. This method calls AddRef internally. To avoid memory leaks, you must call Release when you are finished using the interface.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.


An XML DOM application can use objects from multiple implementations. This method provides access to a pointer to an IXMLDOMImplementation interface that handles this document.

Example Code

The following example retrieves a pointer to an IXMLDOMImplementation interface.

#include "wmsserver.h"
#include <atlbase.h> // Includes CComVariant and CComBSTR.

// Declare variables.
IWMSServer*             pServer;
IXMLDOMDocument*        pPlaylist;
IXMLDOMImplementation*  pXMLImp;

HRESULT                 hr;
CComBSTR                bstrFeature;
CComBSTR                bstrVersion;
CComVariant             varFile;
VARIANT_BOOL            bIsSuccessful;
VARIANT_BOOL            bHasFeature;

// 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 an IXMLImplementation interface. 
    hr = pPlaylist->get_implementation(&pXMLImp);
    if (FAILED(hr)) goto EXIT;

    // TODO: Release temporary COM objects and uninitialize COM.


Header: wmsserver.h.

Library: WMSServerTypeLib.dll.

Platform: Windows ServerĀ 2003 family, Windows ServerĀ 2008 family.

See Also

Previous Next