Prev Next

InitAtomTable info  Overview  Group

The InitAtomTable function initializes the local atom table and sets it to the specified size.

BOOL InitAtomTable(

    DWORD nSize 

// size of atom table

   );

Parameters

nSize
Specifies the size, in table entries, of the atom table. This value should be a prime number.

The atom table is a hash table. You will get better performance by passing a prime number in nSize, up to the maximum number of atoms possible, which is 0x3FFF (0xC001 through 0xFFFF).

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

An application need not use this function to use a local atom table. The default size of the local and global atom tables is 37 table entries. If an application does use InitAtomTable, however, it should call the function before any other atom-management function.

If an application uses a large number of local atoms, it can reduce the time required to add an atom to the local atom table or to find an atom in the table by increasing the size of the table. However, this increases the amount of memory required to maintain the table.

The size of the global atom table cannot be changed.

See Also

AddAtom, DeleteAtom, FindAtom, GetAtomName, GlobalAddAtom, GlobalDeleteAtom, GlobalFindAtom, GlobalGetAtomName