Jump to content

SOMFree

From EDM2
Revision as of 15:24, 11 October 2017 by Martini (talk | contribs)

Template:DISPLAYTITLEsomFree This instance method is called to allow the object to add the View 1 page to its Settings notebook.

Syntax

#define INCL_WINWORKPLACE
#include <os2.h>

WPClock     *somSelf;       /*  Pointer to the object on which the method is being invoked. */
HWND         hwndNotebook;  /*  Settings notebook handle. */
ULONG        rc;            /*  Page identifier. */

rc = _wpAddClockView1Page(somSelf, hwndNotebook);

Parameters

somSelf (WPClock *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPClock.
hwndNotebook (HWND) - input
Settings notebook handle.

Return Code

rc (ULONG) - returns

  • Page identifier.
  • Error occurred
PageId
Identifier for the inserted page.

Remarks

This function frees the block of memory pointed to by ptr. This function should only be called with a pointer previously allocated by SOMMalloc or SOMCalloc. This function has the same interface as the C free function. It performs the same basic function as free with some supplemental error checking. If an error occurs, the SOMError function is called. This routine is replaceable by changing the value of the global variable SOMFree.

To free an object (rather than a block of memory), use the somFree method, rather than this function.

Example Code

#include <som.h>
main()
{
   somToken ptr = SOMMalloc(20);
   SOMFree(ptr);
}

Related

Functions

  • SOMCalloc
  • SOMRealloc
  • SOMMalloc

Methods