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


[Back] [Next]