Jump to content

WinDestroyAtomTable: Difference between revisions

From EDM2
Created page with "This function destroys a private atom table, which is created by WinCreateAtomTable. ==Syntax== WinDestroyAtomTable(hatomtblAtomTbl); ==Parameters== ; hatomtblAtomTbl ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function destroys a private atom table, which is created by [[WinCreateAtomTable]].  
This function destroys a private atom table, which is created by [[WinCreateAtomTable]].


==Syntax==
==Syntax==
  WinDestroyAtomTable(hatomtblAtomTbl);
  WinDestroyAtomTable(hatomtblAtomTbl)


==Parameters==
==Parameters==
; hatomtblAtomTbl (HATOMTBL) - input
;hatomtblAtomTbl (HATOMTBL) - input:Atom-table handle.
:Atom-table handle.
:This is the handle returned from a previous call to the WinCreateAtomTable function. If NULL then this function does nothing.
:This is the handle returned from a previous call to the WinCreateAtomTable function. If NULL then this function does nothing.
==Returns==
==Returns==
;rc (HATOMTBL) - returns
;rc (HATOMTBL) - returns:Return code.
:Return code.
:;Function successful.  
:;Function successful.  
:;Other
:;Other
Line 17: Line 16:
==Errors==
==Errors==
Possible returns from WinGetLastError
Possible returns from WinGetLastError
:;PMERR_INVALID_HATOMTBL (0x1013)
:PMERR_INVALID_HATOMTBL (0x1013): An invalid atom-table handle was specified.
::An invalid atom-table handle was specified.
 
==Remarks==
==Remarks==
This function makes no attempt to ensure that the handle to the atom table is not reused by a later call to the WinCreateAtomTable function.
This function makes no attempt to ensure that the handle to the atom table is not reused by a later call to the WinCreateAtomTable function.


The system atom table (see the WinQuerySystemAtomTable function) cannot be destroyed.  
The system atom table (see the WinQuerySystemAtomTable function) cannot be destroyed.
 
==Example Code==
==Example Code==
This example destroys an Atom Table of one atom, based on its handle, which is returned by WinCreateAtomTable.
This example destroys an Atom Table of one atom, based on its handle, which is returned by WinCreateAtomTable.
Line 44: Line 44:


hatomtblDestroy = WinDestroyAtomTable(hatomtblAtomTbl);
hatomtblDestroy = WinDestroyAtomTable(hatomtblAtomTbl);
</pre>
</pre>


Line 56: Line 55:


rc = WinDestroyAtomTable(hatomtblAtomTbl);
rc = WinDestroyAtomTable(hatomtblAtomTbl);
</pre>
</pre>



Latest revision as of 22:37, 11 December 2023

This function destroys a private atom table, which is created by WinCreateAtomTable.

Syntax

WinDestroyAtomTable(hatomtblAtomTbl)

Parameters

hatomtblAtomTbl (HATOMTBL) - input
Atom-table handle.
This is the handle returned from a previous call to the WinCreateAtomTable function. If NULL then this function does nothing.

Returns

rc (HATOMTBL) - returns
Return code.
Function successful.
Other
The call fails and the atom table has not been destroyed, in which case this is equal to the hatomtblAtomTbl parameter.

Errors

Possible returns from WinGetLastError

PMERR_INVALID_HATOMTBL (0x1013): An invalid atom-table handle was specified.

Remarks

This function makes no attempt to ensure that the handle to the atom table is not reused by a later call to the WinCreateAtomTable function.

The system atom table (see the WinQuerySystemAtomTable function) cannot be destroyed.

Example Code

This example destroys an Atom Table of one atom, based on its handle, which is returned by WinCreateAtomTable.

#define INCL_WINATOM            /* Window Atom Functions        */
#include <os2.h>

ATOM  atom;             /* new atom value                       */
HATOMTBL  hatomtblAtomTbl; /* atom-table handle                 */
HATOMTBL  hatomtblDestroy; /* result of destroy table           */
char   pszAtomName[10]; /* atom name                            */
USHORT  usInitial = 0;  /* initial atom table size (use default)*/
USHORT  usBuckets = 0;  /* size of hash table (use default)     */

/* create atom table of default size */
hatomtblAtomTbl = WinCreateAtomTable(usInitial, usBuckets);

/* define name for new atom and add to table */
strcpy(pszAtomName,"newatom");
atom = WinAddAtom(hatomtblAtomTbl, pszAtomName);

hatomtblDestroy = WinDestroyAtomTable(hatomtblAtomTbl);

Definition

#define INCL_WINATOM /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HATOMTBL    hatomtblAtomTbl;  /*  Atom-table handle. */
HATOMTBL    rc;               /*  Return code. */

rc = WinDestroyAtomTable(hatomtblAtomTbl);

Related Functions