Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
To create a global atom, call the GlobalAddAtomfunction. This function requires a pointer to a string that specifies the atom name for the atom that you want to create. GlobalAddAtomsearches the atom table for the string to determine if the string already exists as an atom name. When you call GlobalAddAtomwith an atom name that the atom table already contains, it returns the existing atom that corresponds to that atom name. If that atom is a string atom, the OS also increments the reference count for the string. If the atom name does not exist in the table when an application calls GlobalAddAtom, GlobalAddAtomadds the atom name to the table and returns a new atom. If the atom is a string atom, the OS also sets the reference count for the atom to one.
To determine whether a particular string is already in the global atom table, call the GlobalFindAtomfunction. This function searches the atom table for the specified string. If GlobalFindAtomfinds the string in the table, it returns the corresponding atom.
Call the GlobalDeleteAtomfunction when your application no longer needs a global atom. For a string atom, GlobalDeleteAtomreduces the reference count of the atom by one. When the reference count reaches zero, the OS deletes the atom name from the table. The atom name of a string atom remains in the global atom table as long as the reference count of the atom is greater than zero, even if the application that placed the atom in the table terminates.