3.1.4.3.2 Item (Opnum 4)

The Item method is received by the server in an RPC_REQUEST packet. In response, the server returns the requested child IAppHostElement object that is contained in the specific IAppHostChildElementCollection object.

 [propget, id(DISPID_VALUE)] HRESULT Item(
   [in] VARIANT cIndex,
   [out, retval] IAppHostElement** ppElement
 );

cIndex: A client-specified VARIANT that specifies the specific child IAppHostElement that is to be returned in the method. If the VARIANT is of type integer, the value represents a zero-based index that specifies the index of the child element to return, where 0 indicates the first child, 1 the second, and so on. The VARIANT can also be of the BSTR type, and if so, represents a string name that specifies the exact name of the child element to return.

ppElement: Receives a pointer to the child IAppHostElement that matches the criteria that is set by the cIndex parameter.

Return Values: The server MUST return zero if it successfully processes the message that is received from the client. In this case, *ppElement MUST NOT be NULL. If processing fails, the server MUST return a nonzero HRESULT code as defined in [MS-ERREF]. The following table describes the error conditions that MUST be handled and the corresponding error codes. A server MAY return additional implementation-specific error codes.

Return value/code

Description

0X00000000

NO_ERROR

The operation completed successfully.

0X80070057

ERROR_INVALID_PARAMETER

One or more parameters are incorrect or null.

0X80070585

ERROR_INVALID_INDEX

The index specified by cIndex is invalid.

0X00000008

ERROR_NOT_ENOUGH_MEMORY

Not enough memory is available to process this command.