wpClose
This instance method is called to close all open views of an object.
Syntax
_wpClose(somSelf)
Parameters
- somSelf (WPObject *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPObject.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE: Successful completion.
- FALSE: Error occurred.
Remarks
This method will cycle through the object's in-use list that was created by calls to the wpAddToObjUseList method. All open windows specified by USAGE_OPENVIEW items send a WM_CLOSE message. Running executables specified by USAGE_OPENVIEW items are terminated.
Usage
This method should be called to close all open views of the object and to free all allocated resources.
How to Override
If this method is overridden, it should call the parent last to ensure that allocated resources are properly deallocated.
Example Code
In this example, when a folder object is closed, we will 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_wpClose(MYFOLDER *somSelf) { MYFOLDERData *somThis = MYFOLDERGetData(somSelf); BOOL rcParentClose; MYFOLDERMethodDebug("MYFOLDER","myfold_wpClose"); rcParentClose = parent_wpClose(somSelf); /* Call parent method first */ _setFirstViewHandle(somSelf, NULLHANDLE); /* Do our thing */ return( rcParentClose ); }