IRequestDictionary::get_Item

The IRequestDictionary::get_Item method retrieves the specified item from a Request object dictionary.

HRESULT get_Item(

  VARIANT Var// contains the name of the item in the collection

  VARIANT * pVariantReturn

      //pointer to a VARIANT that receives the item value

);

 

Parameters
Var
[in] Contains the name of the item in the collection.
pVariantReturn
[retval] [out] Points to a VARIANT that receives the item value.
Remarks

Automation objects can specify that one or more VARIANT parameters are optional. This is done by passing the parameter with the type set to VT_ERROR and a value of DISP_E_PARAMNOTFOUND. For example, if you want to do this with the Var parameter, the value it returns will depend on the object's implementation of the IRequestDictionary interface. The QueryString object would then return the entire query string.

If Var is not an optional parameter then it must be a VT_BSTR or a VT_DISPATCH pointer with a default value that can be converted to a BSTR. In this case, the BSTR value of Var is looked up in the appropriate dictionary, and the value of Var is returned. If Var is not in the dictionary, then a VARIANT equal to VT_EMPTY is returned if the IRequestDictionary is covering one of the Request object's collections. If the IRequestDictionary pointer is the Response.Cookies collection, a new cookie with the name of Var is created, and that cookie is returned. If Var is not a BSTR (and not DISP_E_PARAMNOTFOUND), then the get_Item method will raise an OLE Automation exception.

See Also

IRequestDictionary