Share via


IWMSContext.SetStringValue (Visual Basic .NET)

banner art

Previous Next

IWMSContext.SetStringValue (Visual Basic .NET)

The SetStringValue method specifies a String value in the context.

Syntax

  

Parameters

pstrName

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

lNameHint

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

pstrValue

String containing the value.

lOptions

Int32 containing either zero or the following WMS_CONTEXT_OPTIONS enumeration flag. If this parameter is zero, the string is specified by value.

Value Description
WMS_CONTEXT_SET_PROPERTY_STRING_BY_REFERENCE The string must be specified by reference.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x80070057 The pstrName parameter is null.
0x8007000E Could not allocate memory for the value.

Example Code

Dim Context As IWMSContext
Dim pUnknown As IntPtr

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)

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

Previous Next