What Are Proxy Objects?

A proxy object acts as an intermediary between the client and an accessible object. The purpose of the proxy object is to monitor the life span of the accessible object and to forward calls to the accessible object only if it is not destroyed.

When a client calls an IAccessible property to get information about an object, the proxy object must check whether the accessible object is still available. If it is, the proxy object forwards the client's request to the accessible object. If the accessible object is destroyed (for example, when a dialog box with custom controls is closed), the proxy object returns an error. To indicate that the object has been destroyed, it is recommended that servers return the error code CO_E_OBJECTNOTCONNECTED because this error is returned by COM after a server calls CoDisconnectObject.

The proxy object is transparent to the client. When the client calls AccessibleObjectFromEvent, AccessibleObjectFromPoint, orAccessibleObjectFromWindow, it receives back a pointer to an IAccessible interface. However, when the client uses this pointer to call any of the IAccessible properties or methods, the code that is executed is within the proxy object.