IWMSPlugin::get_MonikerName
Previous | Next |
IWMSPlugin::get_MonikerName
The get_MonikerName method retrieves a moniker display name for a plug-in.
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_INVALID_ARCHIVE | 0xc00d003 | The namespace containing the moniker name could not be opened. |
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 plug-in.
Example Code
The following example retrieves the moniker name for the WMS Anonymous User Plug-in included with Windows Media Services. The moniker equals "WMSServer:server_name\Authentication\Object Store\WMS Anonymous User Authentication".
#include <windows.h> #include <atlbase.h> // Includes CComBSTR and CComVariant. #include "wmsserver.h" // Declare variables and interfaces. IWMSServer *pServer; IWMSPlugins *pPlugins; IWMSPlugin *pPlugin; 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 an IWMSPlugins interface. hr = pServer->get_Authenticators(&pPlugins); if (FAILED(hr)) goto EXIT; // Retrieve the WMS Anonymous User Authentication // plug-in. varIndex = L"WMS Anonymous User Authentication"; hr = pPlugins->get_Item(varIndex, &pPlugin); if (FAILED(hr)) goto EXIT; // Retrieve the moniker name for the plug-in. hr = pPlugin->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 |