IXMLDOMImplementation::hasFeature
Previous | Next |
IXMLDOMImplementation::hasFeature
The hasFeature method retrieves a Boolean value indicating whether the specified version of the implementation supports the specified feature.
Syntax
HRESULT hasFeature( BSTR bstrFeature, BSTR bstrVersion, VARIANT_BOOL* varHasFeature );
Parameters
bstrFeature
[in] BSTR containing the feature to test. In Level 1, valid feature values are "XML," "DOM," and "MS-DOM" (not case-sensitive).
bstrVersion
[in] BSTR containing the version number to test. If the string is empty, the method tests for implementation of the feature in all versions. In Level 1, "1.0" is the only valid version value.
varHasFeature
[out] Pointer to a VARIANT_BOOL indicating if the specified feature is implemented.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Remarks
In the Windows Media Services SDK implementation of the XML DOM, the retrieved value will always be false.
Example Code
#include "wmsserver.h" #include <atlbase.h> // Includes CComVariant and CComBSTR. // Declare variables. IWMSServer* pServer; IXMLDOMDocument* pPlaylist; IXMLDOMImplementation* pXMLImplementation; HRESULT hr; VARIANT_BOOL bHasFeature; CComBSTR bstrFeature; CComBSTR bstrVersion; // 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); // Retrieve a pointer to the IXMLDOMImplementation interface. hr = pPlaylist->get_implementation(&pXMLImplementation); if (FAILED(hr)) goto EXIT; // Retrieve a Boolean value indicating whether // this XML implementation contains certain features. bstrFeature = "DOM"; bstrVersion = "1.0"; hr = pXMLImplementation->hasFeature(bstrFeature, bstrVersion, &bHasFeature); 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 |