IWMSContext::SetLongValue

banner art

Previous Next

IWMSContext::SetLongValue

The SetLongValue method specifies a long value in the context.

Syntax

  HRESULT SetLongValue(
  LPCWSTR  pstrName,
  long  lNameHint,
  long  lValue,
  long  lOptions
);

Parameters

pstrName

[in] LPCWSTR specifying the name portion of the name-value pair in the context.

lNameHint

[in] long containing an optional key that can be used to more efficiently access a value.

lValue

[in] long value for the context.

lOptions

[in] long containing either zero or the WMS_CONTEXT_SET_PROPERTY_NAME_BY_VALUE enumeration flag defined in the WMS_CONTEXT_OPTIONS enumeration type. By default, the name is specified by reference.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Number Description
E_INVALIDARG 0x80070057 The pstrName parameter is NULL.
E_OUTOFMEMORY 0x8007000E Could not allocate memory for the value.

Example Code

// Declare variables.
long lPubPointType = 0;

// The publishing point is a broadcast type.
lPubPointType = WMS_CACHE_CONTENT_TYPE_BROADCAST;

// Use a pointer to the content information context to 
// identify the type of the cached content.
hr = pContentInfo->SetLongValue( 
              WMS_CACHE_CONTENT_INFORMATION_CONTENT_TYPE,
              WMS_CACHE_CONTENT_INFORMATION_CONTENT_TYPE_ID,
              lPubPointType,
              0 );
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary objects.

Requirements

Header: wmscontext.h.

Library: WMSServerTypeLib.dll.

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

See Also

Previous Next