Jump to content

wpQueryPointerFromContents

From EDM2
Revision as of 02:48, 25 November 2025 by Martini (talk | contribs) (Created page with "{{DISPLAYTITLE:wpQueryPointerFromContents}} This method is specific to Version 4, or higher, of the OS/2 operating system. This instance method returns a pointer to shared memory containing the contents of the WPDataFile object. ==Syntax== _wpQueryPointerFromContents(somSelf) ==Parameters== ;''somSelf'' (WPDataFile *) - input :Pointer to the object on which the method is being invoked. :Points to an object of class WPDataFile. ==Returns== ;''pData'' (P...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This method is specific to Version 4, or higher, of the OS/2 operating system.

This instance method returns a pointer to shared memory containing the contents of the WPDataFile object.

Syntax

_wpQueryPointerFromContents(somSelf)

Parameters

somSelf (WPDataFile *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPDataFile.

Returns

pData (PVOID) - returns
Pointer to shared memory if successful, or **NULL** if unsuccessful.
The first word is a **ULONG** that contains the length, followed immediately by the data.

How to Override

This method is not generally overridden.

Usage

This method can be called at any time to obtain a pointer to a memory segment containing the contents of the data file.

Remarks

The caller of the **wpQueryPointerFromContents** method is responsible to free the returned memory segment by calling the **DosFreeMem** function.

Example Code

#define INCL_WINWORKPLACE
#include <os2.h>

WPDataFile *somSelf; /* Pointer to the object on which the method is being invoked. */
PVOID pData; /* Pointer to shared memory if successful, or NULL if unsuccessful. */

pData = _wpQueryPointerFromContents(somSelf);

/* Example code provided in the source: */
    PVOID pData;

    /* Get the data from the data file  */
    pData = _wpQueryPointerFromContents(somSelf);

    /****** Process the data from the data file *****/

    /* Free the shared memory object      */
    DosFreeMem(pData);

Related Methods