Article View: borland.public.cppbuilder.nativeapi
Article #7453Re: Hex GUID
From: Andrue Cope [TeamB]
Date: Mon, 31 Jan 2005 12:29
Date: Mon, 31 Jan 2005 12:29
46 lines
1920 bytes
1920 bytes
Thomas J. wrote:
> Is any API available which creates a Hex GUID. I need a hexdecimal
> unique string as a PK for a database record.
If you're using the VCL there is GUIDToString().
If the VCL is out then all I could find in a quick trawl of the help
was:
HRESULT CoCreateGuid(
GUID *pguid //Receives a pointer to the GUID on return
);
typedef struct _GUID {
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
/*
Data1
Specifies the first eight hexadecimal digits of the UUID.
Data2
Specifies the first group of four hexadecimal digits of the UUID.
Data3
Specifies the second group of four hexadecimal digits of the UUID.
Data4
Specifies an array of eight elements that contains the third and final
group of eight hexadecimal digits of the UUID in elements 0 and 1, and
the final 12 hexadecimal digits of the UUID in elements 2 through 7
*/
Then you create a string hex representation of the GUID yourself.
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<41fe24d9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<41fe2177$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,dcc425ac9e5f44c2 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address> Subject: Re: Hex GUID Newsgroups: borland.public.cppbuilder.nativeapi References: <41fe2177$1@newsgroups.borland.com> Date: Mon, 31 Jan 2005 12:29:27 +0000 User-Agent: XanaNews/1.17.1.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 217.207.223.34 Message-ID: <41fe24d9$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1107174617 217.207.223.34 (31 Jan 2005 04:30:17 -0800) Lines: 46 X-Authenticated-User: acope Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail