Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

IUIAutomation::ElementFromIAccessibleBuildCache method

Retrieves a UI Automation element for the specified accessible object from a Microsoft Active Accessibility server, prefetches the requested properties and control patterns, and stores the prefetched items in the cache.


HRESULT ElementFromIAccessibleBuildCache(
  [in]          IAccessible               *accessible,
  [in]          int                       childId,
  [in]          IUIAutomationCacheRequest **cacheRequest,
  [out, retval] IUIAutomationElement      **element


accessible [in]

Type: IAccessible*

A pointer to the IAccessible interface of the accessible object.

childId [in]

Type: int

The child ID of the accessible object.

cacheRequest [in]

Type: IUIAutomationCacheRequest**

The address of the cache request that specifies the properties and control patterns to store in the cache.

element [out, retval]

Type: IUIAutomationElement**

Receives a pointer to the UI Automation element.

Return value


If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


This method enables Microsoft UI Automation clients to get IUIAutomationElement interfaces for accessible objects implemented by a Microsoft Active Accessibility server.

This method may fail if the server implements UI Automation provider interfaces alongside Microsoft Active Accessibility support.

The method returns E_INVALIDARG if the underlying implementation of the UI Automation element is not a native Microsoft Active Accessibility server; that is, if a client attempts to retrieve the IAccessible interface for an element originally supported by a proxy object from Oleacc.dll, or by the UIA-to-MSAA Bridge.


Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista, Windows XP with SP3 and Platform Update for Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008, Windows Server 2003 with SP2 and Platform Update for Windows Server 2008 [desktop apps only]


UIAutomationClient.h (include UIAutomation.h)



See also




Community Additions

© 2015 Microsoft