출처 행복하세요~ | 논스모커
원문 https://blog.naver.com/ttcoupe/20017784895
MFC Library Reference
CDocument::DeleteContents
Called by the framework to delete the document's data without destroying the CDocument object itself.
//CDocument 객체 자체를 없에지 않고, document에 있는 내용을 지운다.
virtual void DeleteContents( );
Remarks
Example
원문 https://blog.naver.com/ttcoupe/20017784895
MFC Library Reference
CDocument::DeleteContents
Called by the framework to delete the document's data without destroying the CDocument object itself.
//CDocument 객체 자체를 없에지 않고, document에 있는 내용을 지운다.
virtual void DeleteContents( );
Remarks
-
It is called just before the document is to be destroyed.
It is also called to ensure that a document is empty before it is reused.
This is particularly important for an SDI application, which uses only one document; the document is reused whenever the user creates or opens another document.
Call this function to implement an "Edit Clear All" or similar command that deletes all of the document's data.
The default implementation of this function does nothing. Override this function to delete the data in your document.
Example
// This example is the handler for an Edit Clear All command.
void CMyDoc::OnEditClearAll()
{
DeleteContents();
UpdateAllViews(NULL);
}
void CMyDoc::DeleteContents()
{
// Re-initialize document data here.
}
댓글
댓글 쓰기