Share via


IWMSContext.GetIUnknownValue (C#)

banner art

Previous Next

IWMSContext.GetIUnknownValue (C#)

The GetIUnknownValue method retrieves an IUnknown value from the context.

Syntax

  

Parameters

pstrName

string specifying the name portion of the name-value pair in the context.

lNameHint

int containing an optional key that can be used to more efficiently access a value.

pValue

Reference to an object containing the value.

lOptions

Reserved for future use.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x8002000B The property specified by the pstrName parameter could not be found.
0x80020005 The data type of the property specified by the pstrName parameter is not VT_UNKNOWN.
0x80004003 pValue is null.

Example Code

Guid ContextGuid = typeof(IWMSContext).GUID;
IWMSContext     Context;
IntPtr          pUnknown;
object          oAuthContext;

try
{          
    m_ClassFactory.AllocIWMSContext(ref ContextGuid,
                                   WMS_CONTEXT_TYPE.WMS_USER_CONTEXT_TYPE,
                                   pUserContext, out pUnknown);
    Context = (IWMSContext)Marshal.GetTypedObjectForIUnknown(pUnknown,
                                                     typeof(IWMSContext));
            
    Context.SetStringValue(WMSDefines.WMS_CONTENT_DESCRIPTION_TITLE,
                           WMSDefines.WMS_CONTENT_DESCRIPTION_TITLE_ID,
                           "My Title", 0);
    Context.SetLongValue(WMSDefines.WMS_CONTENT_DESCRIPTION_NO_SKIP,
                         WMSDefines.WMS_CONTENT_DESCRIPTION_NO_SKIP_ID,
                         1, 0);

    Context.GetIUnknownValue(WMSDefines.WMS_USER_AUTHENTICATOR,
                             WMSDefines.WMS_USER_AUTHENTICATOR,
                             out oAuthContext, 0);
}
catch( Exception e )
{
    // TODO: Handle exceptions.
}

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Previous Next