Certainly if you are on a Windows machine, the easiest way to get a GUID is
to call the CoCreateGuid() function. If you want to create the values on
the Palm device, you have to come up with something that will spit out 128
bits that are reasonably certain of being unique.
Note that GUIDs in Windows are not guaranteed to be globally unique if the
machine they are generated on does not have an network card (or something
else that provides its 802.x address). Quoting the doc:
In Windows NT 4.0, Windows 2000, Windows 95, DCOM release, and Windows 98,
UuidCreate returns RPC_S_UUID_LOCAL_ONLY when the originating computer does
not have an ethernet/token ring (IEEE 802.x) address. In this case, the
generated UUID is a valid identifier, and is guaranteed to be unique among
all UUIDs generated on the computer. However, the possibility exists that
another computer without an ethernet/token ring address generated the
identical UUID. Therefore you should never use this UUID to identify an
object that is not strictly local to your computer. Computers with
ethernet/token ring addresses generate UUIDs that are guaranteed to be
globally unique.
>Microsoft GUID's are based on a magic hashing of a date/time stamp and
>network card MAC address. If no network card is in the PC then the
algorithm
>somehow compensates and uses another source of information from the PC to
>add uniqueness to the GUID. The process is documented in various books
>(Hardcore Visual Basic) and the API's for generating GUID's are available,
>but I don't believe the actual algorithm or source code is readily
>available.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/