Jump to content

wpclsNew

From EDM2
Revision as of 22:52, 24 May 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:wpclsNew}} This class method creates a new instance of a given class of object. ==Syntax== <PRE> wpclsNew = _wpclsNew(somSelf, pszTitle, pszSetupEnv, Folder, fLock); </PRE> ==Parameters== ;''somSelf'' (M_WPObject *) - input :Pointer to the WPObject class object. ;''pszTitle'' (PSZ) - input :Pointer to a null-terminated string which contains the initial title of the object as it is to appear when displayed on the user interface underneath an...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This class method creates a new instance of a given class of object.

Syntax

wpclsNew = _wpclsNew(somSelf, pszTitle, pszSetupEnv, Folder, fLock);

Parameters

somSelf (M_WPObject *) - input
Pointer to the WPObject class object.
pszTitle (PSZ) - input
Pointer to a null-terminated string which contains the initial title of the object as it is to appear when displayed on the user interface underneath an icon or on the title bar of an open object.
pszSetupEnv (PSZ) - input
Pointer to a zero-terminated string which contains the environment setup string of the new object. The `pszSetupEnv` string is extracted when the wpSetup method is called. Refer to wpSetup for the description of this field for the class of the object being created.
Folder (WPFolder *) - input
Pointer to the 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. Possible values are described in the following list:
  • TRUE: The new object remains awake until the caller issues the wpUnlockObject method on it.
  • FALSE: The newly created object is made dormant whenever the object and the folder containing the object are closed.

Returns

wpclsNew (WPObject *) - returns
Pointer to the new object.
Value Description
Non-NULL Pointer to the new object.
NULL Error occurred.

Remarks

This method is a modified version of somNew that takes arguments. These arguments provide a way to create a new object with a defined state.

Usage

This method can be called at any time to create a new workplace object. The created object is a persistent instance of the class specified by WPClass.

How to Override

This method can be overridden only in a metaclass.

Related Methods