Jump to content

wpCreateFromTemplate

From EDM2
Revision as of 06:10, 4 November 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:wpCreateFromTemplate}} This instance method is called to create an object from a template. ==Syntax== _wpCreateFromTemplate(somSelf, folder, fLock) ==Parameters== ;''somSelf'' (WPObject *) - input :Pointer to the object on which the method is being invoked. :Points to an object of class WPObject. ;''folder'' (WPFolder *) - input :Pointer to a Folder object in which to place the new object. This pointer can be determined by issuing a call to...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This instance method is called to create an object from a template.

Syntax

_wpCreateFromTemplate(somSelf, folder, fLock)

Parameters

somSelf (WPObject *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPObject.
folder (WPFolder *) - input
Pointer to a Folder object in which to place the new object. This pointer can be determined by issuing a call to the wpclsQueryFolder method.
fLock (BOOL) - input
Lock object flag.
If this flag is **FALSE**, the newly created object will be made dormant whenever the object and the folder containing the object are closed.
If this flag is **TRUE**, the new flag will remain active until the caller issues the wpUnlockObject method on it.

Returns

rc (WPObject *) - returns
Pointer to the new object.
A return value of **NULL** indicates that an error occurred.

How to Override

This method is generally not overridden.

Usage

This method can be called at any time in order to create a new object from a template object.

Remarks

The new object will be an identical copy of the template object except that the `OBJSTYLE_TEMPLATE` object style will be taken out. wpCopiedFromTemplate will be called on the new object.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPObject *somSelf; /* Pointer to the object on which the method is being invoked. */
WPFolder *folder; /* Pointer to a Folder object. */
BOOL fLock; /* Lock object flag. */
WPObject *rc; /* Pointer to the new object. */

rc = _wpCreateFromTemplate(somSelf, folder,
        fLock);

Related Methods