Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IWMSContext::SetValue
The SetValue method specifies a VARIANT value in the context.
Syntax
HRESULT SetValue( LPCWSTR pstrName, long lNameHint, VARIANT Value, 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.
Value
[in] VARIANT value for the context.
lOptions
[in] Reserved for future use.
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
// Use a pointer to the user context to specify a temporary
// property.
CComVariant var( ( double ) fRate );
if(NULL ! pUserContext)
{
hr = pUserContext->SetValue( L"Rate",
WMS_CONTEXT_NO_NAME_HINT,
var,
WMS_CONTEXT_SET_PROPERTY_NAME_BY_VALUE );
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 |