wpIdentify
This method is specific to Version 4, or higher, of the OS/2 operating system.
This instance method returns a string that is unique within a given container that identifies the specified object.
Syntax
_wpIdentify(somSelf, pszIdentity)
Parameters
- somSelf (WPObject *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPObject.
- pszIdentity (PSZ) - output
- A unique string that identifies the specified object. The string is of the form **CCCCIIII** where **CCCC** is the class name and **IIII** is a unique string identifier provided by the base class (the real file name in the case of WPFileSystem).
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE Successful completion.
- FALSE Error occurred.
How to Override
This method can be overridden in any object class that wants to append a unique qualifier to the end of the standard identity string for an object. This method should only be overridden by storage classes. You should always call this method first, then append extra information to the **pszIdentity** string. (For example, WPObject puts in the class name string, but its subclasses are responsible for putting in the unique identifier.)
Usage
This method can be called at any time to obtain a unique identifier for an object.
Example Code
#define INCL_WINWORKPLACE #include <os2.h> WPObject *somSelf; /* Pointer to the object on which the method is being invoked. */ PSZ pszIdentity; /* A unique string that identifies the specified object. */ BOOL rc; /* Success indicator. */ rc = _wpIdentify(somSelf, pszIdentity);
Remarks
The buffer pointed to by **pszIdentity** must always be at least **CCHMAXIDENT** characters in length.
Example Code
In this example, we obtain the identity string for an object.
CHAR szIdentity[CCHMAXSTRING];
_wpQueryIdentity(somSelf,szIdentity);