WinDestroyAtomTable
Appearance
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);