wpQueryHandle
This instance method returns a unique, persistent object handle for the given object.
Syntax
_wpQueryHandle(somSelf);
Parameters
- somSelf (WPObject *) - input
- Pointer to the object on which the method is being invoked.
- Points to an object of class WPObject.
Returns
- hObject (HOBJECT) - returns
- Persistent handle for the given object.
- The high word of this handle is filled out by WPObject to identify the base class. The low word is filled out by the base class to allow it to locate the object.
Remarks
The object handle returned from this method is the same handle that can either be used for the WinCreateObject, WinSetObjectData or WinDestroyObject. The handle is unique on a given machine so the returned object handle can be passed to other processes or stored for later use (even across IPLs of the system). For more information about WinCreateObject, WinSetObjectData, and WinDestroyObject, see the Presentation Manager Programming Reference. Note: It is recommended that **wpQueryHandle** be used sparingly on file-based object classes because the operating system keeps track of the current location of every file object that has been allocated an object handle. Performance could be adversely affected if object handles are obtained for every file-system object that was ever awakened.
Using HOBJECT for .INI files or files in which an application uses a rename/save/delete sequence is not supported.
Usage
This method can be called at any time to get a handle that is both persistent across IPLs and completely unique on the given machine.
How to Override
This method is generally not overridden.
Example Code
Declaration:
#define INCL_WINWORKPLACE #include <os2.h> WPObject *somSelf; /* Pointer to the object on which the method is being invoked. */ HOBJECT hObject; /* Persistent handle for the given object. */ hObject = _wpQueryHandle(somSelf);