共用方式為


CDocument::OnCloseDocument

Called by the framework when the document is closed, typically as part of the File Close command.

virtual void OnCloseDocument( );

Remarks

The default implementation of this function destroys all of the frames used for viewing the document, closes the view, cleans up the document's contents, and then calls the DeleteContents member function to delete the document's data.

Override this function if you want to perform special cleanup processing when the framework closes a document. For example, if the document represents a record in a database, you may want to override this function to close the database. You should call the base class version of this function from your override.

Requirements

Header: afxwin.h

See Also

Reference

CDocument Class

Hierarchy Chart

CDocument::DeleteContents

CDocument::OnNewDocument

CDocument::OnOpenDocument