🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7145

Re: How to generate GUID number within an BCB6 build apps?

#7145
From: Michel Leunen
Date: Mon, 07 Mar 2005 19:17
30 lines
1836 bytes
Lee wrote:

> How can I generate Globally Unique IDentifier (GUID) number in my 
> application? Is there any API for this? Any example?. 

Another way :

#include <rpcde.h>

UUID uuid;
HRESULT hr = UuidCreateSequential(&uuid);
if (hr == RPC_S_OK)
{
    unsigned char *buf;
    hr = UuidToString(&uuid, &buf);
    if (hr == RPC_S_OK)
    {
       std::cout<<buf<<std::endl;
       RpcStringFree(&buf);
    }
}

Michel
-- 
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
Technical Details
Message-ID: <422ca8dd$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!212.20.144.77.MISMATCH!gatel-ffm!gatel-ffm!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <422c671a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e0e77bbefc54c2e9
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 07 Mar 2005 20:17:53 +0100
From: Michel Leunen <nospam@noreply.please>
Organization: www.leunen.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217
X-Accept-Language: fr-be, en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How to generate GUID number within an BCB6 build apps?
References: <422c671a$1@newsgroups.borland.com>
In-Reply-To: <422c671a$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.243.94.192
Message-ID: <422ca8dd$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1110223069 81.243.94.192 (7 Mar 2005 11:17:49 -0800)
Lines: 30
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx02.iad01.newshosting.com!212.20.144.77.MISMATCH!gatel-ffm!gatel-ffm!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail