IWMSBroadcastPublishingPoint2::get_EnableStartVRootOnServiceStart

banner art

Previous Next

IWMSBroadcastPublishingPoint2::get_EnableStartVRootOnServiceStart

The get_EnableStartVRootOnServiceStart method retrieves a Boolean value that indicates whether the publishing point automatically starts when Windows Media Services starts.

  • **Note   **Except for Windows Server 2003, Web Edition, this method is available only on the x64-based versions of Windows Server 2003 and on the 32-bit versions of Windows Server 2003 with Service Pack 1. This method is also available on Window Server 2008.

Syntax

  HRESULT get_EnableStartVRootOnServiceStart(
  VARIANT_BOOL*  pVal
);

Parameters

pVal

[out]  Pointer to a VARIANT_BOOL that indicates whether the publishing point automatically starts when Windows Media Services starts.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.

Remarks

The default value is VARIANT_FALSE.

Example Code

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

// Declare variables and interfaces.
IWMSServer                    *pServer;
IWMSPublishingPoints          *pPubPoints;
IWMSPublishingPoint           *pPubPoint;
IWMSBroadcastPublishingPoint2 *pBCPubPoint2;

HRESULT                       hr;
CComVariant                   varIndex;
long                          lCount;
VARIANT_BOOL                  bVal;

// 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;

// Retrieve a pointer to the IWMSPublishingPoints
// interface and retrieve the number of publishing points.
hr = pServer->get_PublishingPoints(&pPubPoints);
if (FAILED(hr)) goto EXIT;

hr = pPubPoints->get_Count(&lCount);
if (FAILED(hr)) goto EXIT;

// Retrieve each publishing point and query the
// IWMSBroadcastPublishingPoint2 interface.
for (long x = 0; x < lCount; x++)
{
    varIndex = x;
    hr = pPubPoints->get_Item(varIndex, &pPubPoint);
    if (FAILED(hr)) goto EXIT;

    // Retrieve the type of publishing point.
    WMS_PUBLISHING_POINT_TYPE pptType;
    hr = pPubPoint->get_Type(&pptType);
    if (FAILED(hr)) goto EXIT;

    if (pptType == WMS_PUBLISHING_POINT_TYPE_BROADCAST)
    {
        hr = pPubPoint->QueryInterface(IID_IWMSBroadcastPublishingPoint2,
                                      (void **)&pBCPubPoint2);
        if (FAILED(hr)) goto EXIT;

        // Retrieve a Boolean value that indicates whether the broadcast
        // publishing point will start when Windows Media Services
        // starts.
        hr = pBCPubPoint2->get_EnableStartVRootOnServiceStart(&bVal);
        if (FAILED(hr)) goto EXIT;

        pBCPubPoint2->Release();
    }

    // Release temporary COM objects.
    pPubPoint->Release();
}

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

Requirements

Header: wmsserver.h.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Standard Edition, with Service Pack 1; Windows Server 2003, Enterprise Edition with Service Pack 1; Windows Server 2003, Datacenter Edition with Service Pack 1; Windows Server 2008.

See Also

Previous Next