In this example, when the last view of a MYFOLDER object is closed, we zero out its first view instance variable, so that the next time it has a first view opened, we can keep track of that.
SOM_Scope BOOL SOMLINK myfold_wpDeleteFromObjUseList(MYFOLDER *somSelf,
PUSEITEM pUseItem )
{
MYFOLDERData *somThis = MYFOLDERGetData(somSelf);
PUSEITEM pItem;
BOOL rcParentCall;
MYFOLDERMethodDebug("MYFOLDER","myfold_wpDeleteFromObjUseList");
/* Call parent's method first */
rcParentCall = parent_wpDeleteFromObjUseList(somSelf, pUseItem);
pItem = _wpFindUseItem(somSelf, USAGE_OPENVIEW, NULL);
if (!pItem) {
_setFirstViewHandle(somSelf, NULLHANDLE);
} /* endif */
return( rcParentCall );
}