IProvHelper::AddProperty


Adds a key name/value pair to a provisioning transaction's property bag. Used by providers that interact with Microsoft. Provisioning Framework (MPF).

A provider can add its own properties to a transaction's property bag. These properties are available to any of the provider handler routines participating in the transaction. Values added to the property bag are preserved across procedure calls, discarded only once the transaction is complete.

Syntax

C++
HRESULT AddProperty  (
	BSTR bstrKey, 
	VARIANT vValue
);
Visual Basic
Sub AddProperty ( _
	bstrKey As String, _
	vValue As Variant  _
)

Parameters

BSTR bstrKey
Key name. If AddProperty passes a bstrKey that already exists, it overwrites the previous property with the new property.
vValue
Value to add.

Return Codes

Zero indicates success; a non-zero value represents an error. For a list of error codes, see MPF Errors.

C++ Example

BSTR bstrKey;
VARIANT vValue;
HRESULT hr = E_OUTOFMEMORY;

bstrKey = ::SysAllocString(L"key");
vValue.lVal = 1234;
vValue.vt = VT_I4;

if(bstrKey)
	hr = m_pProvHelper->AddProperty(bstrKey, vValue);

::SysFreeString(bstrKey);
::VariantClear(vValue);

Visual Basic Example

Dim strKey
Dim vValue

strKey = "key"
vValue = 1234
Call mProvHelper.AddProperty(strKey, vValue)

See Also

DeleteProperty, IProvHelper, QueryProperty


Up Top of Page
) 1999-2002 Microsoft Corporation. All rights reserved.