How to Handle WM_GETOBJECT
When it receives a WM_GETOBJECT message that contains OBJID_CLIENT, the server must return a pointer to the object that implements IAccessible. This pointer is an LRESULT that is obtained by calling LresultFromObject. Microsoft Active Accessibility, in conjunction with the Component Object Model (COM) library, performs the appropriate marshaling and passes the IAccessible interface pointer from the server to the client.
Servers must correctly handle reference counting on the accessible object. Remember that when you create a COM object, the reference count is 1. LresultFromObject then further increments the reference count several times. All the references created by LresultFromObject are automatically released when the object is no longer needed, but the server is responsible for releasing the initial reference, and unless it does so, the object will never be destroyed. The examples in the following sections show how to release references to accessible objects.
Servers typically handle WM_GETOBJECT in one of the following ways:
- Create New Accessible Objects
- Reuse Existing Pointers to Objects
- Create New Interfaces to the Same Object