Jump to content

SOMFree: Difference between revisions

From EDM2
Created page with "==Description== This instance method is called to allow the object to add the View 1 page to its Settings notebook. ==Syntax== <PRE> #define INCL_WINWORKPLACE #include <os2...."
 
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
==Description==
This instance method is called to allow the object to add the View 1 page to its Settings notebook.  
This instance method is called to allow the object to add the View 1 page to its Settings notebook.  


Line 13: Line 12:
rc = _wpAddClockView1Page(somSelf, hwndNotebook);
rc = _wpAddClockView1Page(somSelf, hwndNotebook);
</PRE>
</PRE>
==Parameters==
==Parameters==
; somSelf (WPClock *) - input : Pointer to the object on which the method is being invoked.
;somSelf (WPClock *) - input : Pointer to the object on which the method is being invoked.
 
:Points to an object of class WPClock.
Points to an object of class WPClock.  
;hwndNotebook (HWND) - input : Settings notebook handle.
 
; hwndNotebook (HWND) - input : Settings notebook handle.
 


==Return Code==
==Return Code==
rc (ULONG) - returns
rc (ULONG) - returns
* Page identifier.
* Page identifier.
* Error occurred
* Error occurred
; PageId : Identifier for the inserted page.
; PageId : Identifier for the inserted page.


==Remarks==
==Remarks==
Line 35: Line 30:


==Example Code==
==Example Code==
<PRE>
<PRE>
#include <som.h>
#include <som.h>
Line 47: Line 41:
==Related==
==Related==
===Functions===
===Functions===
* [[SOMCalloc]]
*SOMCalloc
* [[SOMRealloc]]
*SOMRealloc
* [[SOMMalloc]]
*SOMMalloc


===Methods===
===Methods===
* [[somFree]]
* [[somFree]]


 
[[Category:The OS/2 API Project]][[Category:SOM Kernel]]
[[Category:The OS/2 API Project]]
[[Category:SOM Kernel]]

Revision as of 21:55, 18 January 2017

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