This example deletes a newly created atom in an Atom Table based on the atom value returned by WinAddAtom.

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

ATOM  atom;             /* new atom value                       */
ATOM  atomDelete;       /* result of atom delete                */
HATOMTBL  hatomtblAtomTbl; /* atom-table handle                 */
char   pszAtomName[10]; /* atom name                            */
ULONG   ulInitial = 0;  /* initial atom table size (use default)*/
ULONG   ulBuckets = 0;  /* size of hash table (use default)     */

/* create atom table of default size */
hatomtblAtomTbl = WinCreateAtomTable(ulInitial, ulBuckets);

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

atomDelete = WinDeleteAtom(hatomtblAtomTbl, atom);


[Back] [Next]