The are several places that might be used for cleanup. Which is the most suitable depends on you application, and the scope of the clean-up.
If it's a doc-view, then it could be in the document's DeleteContents method, or destructor. Or in the view's OnDestroy or destructor.
It could be in the CWinApp's ExitInstance, or destructor.
/Per
www.perfnurt.se