IOrderForm::AddItem

The AddItem method adds an item to the OrderForm object's Items collection, including the item's SKU, quantity, and placed price. The Items collection is an instantiated ISimpleList interface pointer to a SimpleList object. A SimpleList object is simply an array of VARIANTs. This array consists of IDictionary interface pointers to the Dictionary objects that store the item information that you pass to AddItem.

Syntax

HRESULT AddItem(
VARIANTvarSKU,// in
longlCount,// in
longlPlacedPrice,// in
IDispatch **ppdispItem// out
);

Parameters

varSKU
A VARIANT that contains the SKU of the item to add.
lCount
The quantity of the item identified by varSKU.
lPlacedPrice
The placed price of the item identified by varSKU.
ppdispItem
If AddItem is successful, ppdispItem contains the address of an instance pointer to the IDispatch interface for the Dictionary that contains the added item, and AddItem calls AddRef on that Dictionary; otherwise, NULL.

Include File

<commerce.h>

Return Value

Internally, the AddItem method uses ISimpleList::Add and IDictionary::put_Value methods to add the Dictionary that contains the item information to the SimpleList. Consequently, if IOrderForm::AddItem fails, the returned HRESULT can be any HRESULT returned by these methods. If successful, AddItem returns S_OK.

Related Topic

IOrderForm::ClearItems


© 1997-1998 Microsoft Corporation. All rights reserved.