IWMSPublishingPoint::get_MonikerName
Previous | Next |
IWMSPublishingPoint::get_MonikerName
The get_MonikerName method retrieves the moniker name for a publishing point.
Syntax
HRESULT get_MonikerName( BSTR* pbstrVal );
Parameters
pbstrVal
[out] Pointer to a BSTR containing the moniker name.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Return code | Number | Description |
NS_E_PUBLISHING_POINT_REMOVED | 0xC00D145A | You cannot retrieve the moniker name because the publishing point has been removed from the server. |
Remarks
A moniker is a persistent COM component that encapsulates both the ability to locate an object or data and to retrieve that object or data into memory. The display name can be used to create the object, in this case a publishing point.
Example Code
The following example retrieves the moniker name for the default on-demand publishing point included with Windows Media Services. The name of this publishing point is simply a forward slash, and the moniker name equals "WMSServer:server_name\Publishing Points\/".
// Declare variables and interfaces. IWMSServer *pServer; IWMSPublishingPoints *pPubPoints; IWMSPublishingPoint *pPubPoint; HRESULT hr; CComVariant varIndex; CComBSTR pbstrMonikerName; // 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 // that contains the collection of publishing points. hr = pServer->get_PublishingPoints(&pPubPoints); if (FAILED(hr)) goto EXIT; // Retrieve the default on-demand publishing point. varIndex = L"/"; hr = pPubPoints->get_Item(varIndex, &pPubPoint); if (FAILED(hr)) goto EXIT; // Retrieve the moniker name of the publishing point. hr = pPubPoint->get_MonikerName(&pbstrMonikerName); if (FAILED(hr)) goto EXIT; EXIT: // 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 |