CreateDraft
Document ShellThe
CreateDraftmethod creates a new most recent draft object in this document.
ODDraft CreateDraft (in ODDraft below, in ODBoolean releaseBelow);
below- A reference to the most recent draft for this document.
releaseBelow- kODTrue if the
belowdraft should be released, otherwisekODFalse.- return value
- A reference to the newly created draft object with exclusive read/write permissions.
DISCUSSION
This method creates, initializes, and returns a new draft object, which is the most recent draft of this document. (To create the base draft of the document, the document shell calls theAcquireBaseDraftmethod instead.)If the
releaseBelowparameter is true, this document removes its reference to thebelowdraft by calling that draft'sReleasemethod.This method initializes the reference count of the returned draft. When the caller has finished using that draft, it should call the draft's
Releasemethod.EXCEPTIONS
kODErrInvalidBelowDraft- The document has previous drafts and the
belowdraft is not the most recent draft of the document.kODErrInvalidPermissions- The
belowdraft has exclusive read/write permissions, and thereleaseBelowparameter is false; this combination is illegal because only the most recent draft can have write permission.SEE ALSO
TheODDocument::AcquireDraftmethod (page 136).
TheODContainer::AcquireDocumentmethod (page 100).
TheODRefCntObject::Releasemethod (page 577).
TheODDraftclass (page 147).
Table 11-1 on page 466 in OpenDoc Programmer's Guide.