IWMSContext.SetArrayValue (C#)

The SetArrayValue method specifies an array of string values.

void IWMSContext.SetArrayValue(
  string pstrName,
  int lNameHint,
  String[] psaValue,
  int lOptions
);

Arguments

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

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

Array of string values.

Reserved for future use.

Return Value

This method does not return a value.

If this method fails, it throws an exception.

Number

Description

0x80070057

The psaValue parameter or the pstrName parameter is null.

0x8007000E

Could not allocate memory for the value.

Example

Guid ContextGuid = typeof(IWMSContext).GUID;
IWMSContext     Context;
IntPtr          pUnknown;
string[]        Colors = {"Red", "Green", "Blue"};

try
{          
    m_ClassFactory.AllocIWMSContext(ref ContextGuid,
                                   WMS_CONTEXT_TYPE.WMS_USER_CONTEXT_TYPE,
                                   pUserContext, out pUnknown);
    Context = (IWMSContext)Marshal.GetTypedObjectForIUnknown(pUnknown,
                                                     typeof(IWMSContext));
            
    Context.SetArrayValue("ColorValues",
                      WMS_CONTEXT_HINT_CONSTANTS.WMS_CONTEXT_NO_NAME_HINT,
                      Colors, 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

Concepts

IWMSContext Object (C#)