CreatePart
TheCreatePartmethod creates a new part in this draft.
ODPart CreatePart (in ODType partType, in ODEditor optionalEditor);
partType- The part kind for the new part, or
kODNULLif you will set the part kind later.optionalEditor- The part editor to be used if the normal binding fails, or
kODNoEditorif you choose not to specify an editor.- return value
- A reference to the newly created part object.
DISCUSSION
You can call this method only if this draft's current permissions provide write access.This method calls the new part's
InitPartmethod to initialize the part object.This method initializes the reference count of the returned part. When you have finished using that part, you should call its
Releasemethod.If this method executes successfully, it marks this draft as dirty.
EXCEPTIONS
kODErrCannotCreatePart- Cannot create the specified part object.
SEE ALSO
TheODTypetype (page 876).
TheODEditortype (page 929).
TheODDraft::AcquirePartmethod (page 156).
TheODPart::InitPartmethod (page 529).
TheODPartclass (page 459).
"Using a Tool Palette to Embed Parts" on page 239 in OpenDoc Programmer's Guide.
"Creating a New Document" on page 292 in OpenDoc Programmer's Guide.
"The InitPart Method" on page 294 in OpenDoc Programmer's Guide.
"Adding an Embedded Part" on page 305 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help