_OrderGroup::PutItemValue
Use this method to put the specified values into the specified keys of the line item.
Definition
HRESULT _OrderGroup::PutItemValue(BSTRstrKey,VARIANTvtValue,VARIANT_BOOLbOverWrite,VARIANTnItemIndex,VARIANTstrOrderFormName);
Parameters
strKey
[in] A BSTR that specifies the key whose attribute will store the value specified by the vtValue parameter.
vtValue
[in] A VARIANT that specifies the value to store in the attribute of the key specified by the strKey parameter.
bOverWrite
[in, optional, defaultvalue (-1)] A VARIANT_BOOL that indicates whether to overwrite the existing attribute of the key specified by the strKey parameter. A value of True indicates that the attribute will be overwritten. A value of False indicates that the attribute will not be overwritten if one already exists.
nItemIndex
[in, optional] A VARIANT that specifies the line-item index.
strOrderFormName
[in, optional] A VARIANT that specifies the OrderForm name.
Return Values
This method returns an HRESULT indicating whether or not it completed successfully. See the Error Values section for more details.
Error Values
This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.
Remarks
If the line-item index is specified, this method sets the name value pair for the specified line item on the OrderForm specified in the strOrderFormName parameter. (The strOrderFormName parameter defaults to "default" if unspecified.)
If the line item index is not specified, this method sets the name value pair for all line items for the specified OrderForm. If no OrderForm name is specified, this method sets the name value pair for all line items in the OrderGroup.
If there is no OrderForm for the strOrderFormName specified in the strOrderFormName parameter, one is created.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.