Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Types of Atoms

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

Applications can create two types of atoms: string atoms and integer atoms. Because the values of integer atoms and string atoms do not overlap, you can use both types of atoms in the same block of code.

When an application passes null-terminated strings to the GlobalAddAtom and GlobalFindAtom functions, the application receives string atoms in return. String atoms have the following properties:

  • The values of string atoms are between MAXINTATOM (0xC000) and 0xFFFF.
  • The case of the string is not significant when an application searches for an atom name in an atom table. Also, the entire string must match in a search operation; no substring matching is performed.
  • The string associated with a string atom can be no larger than 256 bytes. This limitation applies to all atom functions.
  • The OS associates a reference count with each atom name. The count is incremented each time the atom name is added to the table and decremented each time the atom name is deleted from the table. By keeping track of the reference count, the OS prevents one application from destroying atom names for another application that uses the same string. When the reference count for an atom name equals zero, the OS removes the atom and the atom name from the table.

Integer atoms differ from string atoms in the following ways:

  • The values of integer atoms are between 0x0001 and MAXINTATOM – 1 (0xBFFF).
  • The OS does not associate a reference count or storage overhead with an integer atom.

Community Additions

Show:
© 2015 Microsoft