IAccessible::get_accParent
The IAccessible::get_accParent method retrieves the IDispatch interface of the object's parent. All objects support this property.
For more information on COM parameter attributes, allocating memory, and freeing memory, see Definitions of Parameter Attributes.
HRESULT get_accParent(
IDispatch** ppdispParent);
Parameters
- ppdispParent
[out, retval] Receives the address of the parent object's IDispatch interface. The variable is set to NULL if no parent exists, or if the child cannot access its parent.
Return Values
If successful, returns S_OK.
If not successful, returns the following value or another standard COM error code. Although servers return these values, clients must always check output parameters to ensure that they contain valid values. For more information, see Checking IAccessible Return Values.
Error | Description |
---|---|
S_FALSE | No parent exists for this object. |
Client Example
The following example function retrieves the parent of an accessible object, if one exists.
HRESULT GetParentObject(IAccessible* pAcc, IAccessible** ppParentAcc) { if (pAcc == NULL) { return E_INVALIDARG; } IDispatch* pDispatch = NULL; HRESULT hr = pAcc->get_accParent(&pDispatch;); if ((hr == S_OK) && (pDispatch != NULL)) { hr = pDispatch->QueryInterface(IID_IAccessible, (void**)ppParentAcc); pDispatch->Release(); } return hr; }
Requirements
** Windows NT/2000/XP/Server 2003:** Included in Windows 2000 and later.
** Windows 95/98/Me:** Included in Windows 98 and later.
** Redistributable:** Requires Active Accessibility 1.3 RDK on Windows NT 4.0 SP6 and Windows 95.
** Header:** Declared in Oleacc.h.
** Library:** Use Oleacc.lib.
See Also
IAccessible::get_accChild, Object Navigation Properties and Methods, IDispatch Interface