This example creates an Atom Table of default size, adds the atom "newatom" to the new table, and then destroys the table.
#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 */ ULONG ulInitial = 0; /* Initial atom table size (use default) */ ULONG ulBuckets = 0; /* Size of hash table (use default) */ /* Create an atom table of the default size */ hatomtblAtomTbl = WinCreateAtomTable(ulInitial, ulBuckets); /* Define the name of the new atom and add it to the table */ strcpy(pszAtomName,"newatom"); atom = WinAddAtom(hatomtblAtomTbl, pszAtomName); hatomtblDestroy = WinDestroyAtomTable(hatomtblAtomTbl);