IAccessible::get_accChild

[This is preliminary documentation and subject to change.]

Retrieves an IDispatch interface address of the child object that has the given child ID or name.

HRESULT get_accChild(
  VARIANT varChild,
  IDispatch** ppdispChild
);
 

Parameters

varChild
[in] VARIANT structure that identifies the child to be retrieved. This parameter can be the child ID value (provided by the object) or a string identifying the child (such as "A1"). The caller must initialize the structure's vt member to indicate which union member is valid prior to the call.
ppdispChild
[out, retval] Address of a pointer variable that will contain the address of the child object's IDispatch interface.

Return Values

Returns S_OK if successful or E_INVALIDARG or another standard COM error code otherwise. The S_FALSE return value indicates that no child object is available.

Note The IDispatch interface returned must be released when the client is finished using it. This can be done by calling the Release() member. Failure to do so will keep the object in memory, causing memory leaks.

This is the only IAccessible method that fails if the application cannot create an OLE object for the child element being referenced.

Implementers: If a container object does not support the IEnumVARIANT interface, its child ID numbers must be sequential positive integers starting with 1. If the object supports IEnumVARIANT, then it can use any method to assign its child ID numbers.

Implementers: If a VT_EMPTY is passed in, then an E_INVALIDARG can be returned, while get_accName and get_accRole get passed with VT_EMPTY, the application will get back valid results.

See Also

IAccessible::get_accParent, Object Navigation, VARIANT Structure, IDispatch Interface, Object, Child Identifiers