Jump to content

WpCopyObject: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:wpCopyObject}} This instance method is called to create a new copy of the object. ; Original Class : WPObject ==Syntax== <PRE> #define INCL_WINWORKPLACE #..."
 
No edit summary
Line 6: Line 6:
==Syntax==
==Syntax==
<PRE>
<PRE>
#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 newly created object. */
rc = _wpCopyObject(somSelf, Folder, fLock);
rc = _wpCopyObject(somSelf, Folder, fLock);
</PRE>
</PRE>
Line 40: Line 33:
==Example Code==
==Example Code==
<PRE>
<PRE>
#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 newly created object. */
rc = _wpCopyObject(somSelf, Folder, fLock);
</PRE>
</PRE>



Revision as of 05:22, 7 November 2017


This instance method is called to create a new copy of the object.

Original Class
WPObject

Syntax

rc = _wpCopyObject(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.
A pointer to a Folder object in which to place this 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 object will remain active until the caller issues the wpUnlockObject method on it.

Return Code

rc (WPObject *) - returns
Pointer to the newly created object.

A return value of NULL indicates that an error occurred.

Remarks

Copies of an object can always be deleted and moved by default, even if the original has the OBJSTYLE_NODELETE or OBJSTYLE_NOMOVE style set.

Override

This method can be overridden by classes which need to keep track of where instances are generated.

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 newly created object. */

rc = _wpCopyObject(somSelf, Folder, fLock);

Related