IT/MFC

CDocument 멤버함수및 기타 설명

KSI 2005. 6. 24. 05:39

CDocument Class Members

Construction

CDocumentConstructs aCDocumentobject.
 

Operations

AddView

Attaches a view to the document.

GetDocTemplateReturns a pointer to the document template that describes the type of the document.
GetFirstViewPosition

Returns the position of the first in the list of views; used to begin iteration.

- 첫번째 뷰의 포지션을 얻는다 .

( 포지션 얻은후 GetNextView 와 함께사용)

GetNextView

Iterates through the list of views associated with the document.

( CList 의  GetNext() 함수와 동일한 역활)

GetPathName

Returns the path of the document’s data file.

( 경로 + 파일이름 + 확장자 )

GetTitle

Returns the document’s title.

IsModified

Indicates whether the document has been modified since it was last saved.

- 도큐먼트 내용이 바뀐것이 있는지 알기위하여

(SetModifiedFlag 함수로 Set 한다)

RemoveViewDetaches a view from the document.
SetModifiedFlagSets a flag indicating that you have modified the document since it was last saved.
SetPathNameSets the path of the data file used by the document.
SetTitleSets the document’s title.
UpdateAllViewsNotifies all views that document has been modified.

Overridables

CanCloseFrameAdvanced overridable; called before closing a frame window viewing this document.
DeleteContentsCalled to perform cleanup of the document.
OnChangedViewListCalled after a view is added to or removed from the document.
OnCloseDocumentCalled to close the document.
OnNewDocumentCalled to create a new document.
OnOpenDocumentCalled to open an existing document.
OnSaveDocumentCalled to save the document to disk.
ReportSaveLoadExceptionAdvanced overridable; called when an open or save operation cannot be completed because of an exception.
GetFileReturns a pointer to the desiredCFileobject.
ReleaseFileReleases a file to make it available for use by other applications.
SaveModifiedAdvanced overridable; called to ask the user whether the document should be saved.
PreCloseFrameCalled before the frame window is closed.

Mail Functions

OnFileSendMailSends a mail message with the document attached.
OnUpdateFileSendMailEnables the Send Mail command if mail support is present.