IWMSContext.GetValue (Visual Basic .NET)

The GetValue method retrieves an Object containing the value assigned to a name-value pair in the context.

IWMSContext.GetValue(  pstrName As String,
  lNameHint As Int32,
  ByRef pValue As Object,
  lOptions As Int32
)

Arguments

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

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

Reference to an Object containing the value.

Reserved for future use.

Return Value

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.

0x80004003

pValue is null.

Example

Dim Context As IWMSContext
Dim pUnknown As IntPtr
Dim oValue As Object

Try
    m_ClassFactory.AllocIWMSContext(GetType(IWMSContext).GUID, _
                                 WMS_CONTEXT_TYPE.WMS_USER_CONTEXT_TYPE, _
                                 pUserContext, pUnknown)
    Context = Marshal.GetTypedObjectForIUnknown(pUnknown, _
                                                GetType(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.GetValue(WMSDefines.WMS_COMMAND_CONTEXT_RATE, _
                     WMSDefines.WMS_COMMAND_CONTEXT_RATE_ID, _
                     oValue, 0)

Catch e As Exception
    ' TODO: Handle exceptions.
End Try

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

Concepts

IWMSContext Object (Visual Basic .NET)