When wpCnrInsertObject puts an object into a container window, its adds a USAGE_RECORD item to the object's in-use list. Conversely, when wpCnrRemoveObject is called, the USAGE_RECORD item is deleted from the object's in-use list and the object is removed from the container. The following figure shows the syntax of the RECORDITEM data structure:
typedef struct _RECORDITEM { HWND hwndCnr; /* Container into which object */ /* is being inserted */ PMINIRECORDCORE pRecord; /* Record pointer within container */ ULONG ulUser; /* For application use */ }RECORDITEM;
Likewise, when wpFreeMem is called to free memory, it calls wpDeleteFromObjUseList to delete a USAGE_MEMORY item from the object's in-use list.
When views are closed by the object's wpClose, wpDeleteFromObjUseList removes the applicable USAGE_OPENVIEW item from the object's in-use list. The wpCnrDeleteUseItem method deletes the USAGE_RECORD use-item for the specified container, but does not remove the object from the container. Use wpCnrRemoveObject to delete the USAGE_RECORD use-item and also to remove the object from the container.