Article View: borland.public.cppbuilder.nativeapi
Article #9433Re: Last trie
From: Edward
Date: Wed, 07 Jul 2004 16:25
Date: Wed, 07 Jul 2004 16:25
64 lines
2733 bytes
2733 bytes
Its the best joice make your own ID number.
But about memset it doesnt work man:
strcpy(biosnro,"inistr");
memset(biosnro, ' ', strlen(biosnro) - 1);
Thanks
Edward
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> escreveu na
mensagem news:40eb8d7b$1@newsgroups.borland.com...
>
> "Edward" <Registrados2004@aol.com> wrote in message
> news:40eb41eb$1@newsgroups.borland.com...
>
> > What I wound up doing, was something much simpler, but just as
effective.
>
> That won't always work, either.
>
> > while(i < sizeof(biosnro))
> > {
> > biosnro[i] = ' ';
> > i++;
> > }
>
> You could use memset() instead of looping manually.
>
> > Reg->OpenKey("\\HARDWARE\\DESCRIPTION\\System", false);
> > if(Reg->KeyExists("\\HARDWARE\\DESCRIPTION\\System"))
> > {
>
> You should be checking the return value of OpenKey() instead of
KeyExists():
>
> if( Reg->OpenKey("\\HARDWARE\\DESCRIPTION\\System", false) )
> {
>
> > Reg->ReadBinaryData("SystemBiosVersion",&biosnro,sizeof(biosnro));
>
> I just checked on my Win98 machine, and although the key you are using
does
> exist, the particular value you are querying does not. Which means that
> your code would fail on my machine, for instance.
>
> > It doenst work because some times the datavaleu os
> > "SystemBiosVersion" are REG_MULTI_SZ other times
> > REG_SZ and other times are Unknow type
>
> And other times it simply does not exist at all.
>
> > I dont know what more i can do.
>
> If all you want is a unique ID, then why not just generate a new GUID via
> the CoCreateGuid() function? It is already guaranteed to produce a unique
> identifier every time it is called.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<40ec23f0@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40c86e9e@newsgroups.borland.com> <40eb41eb$1@newsgroups.borland.com> <40eb8d7b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e3066f787953dff9 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Edward" <Registrados2004@aol.com> From: "Edward" <Registrados2004@aol.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40c86e9e@newsgroups.borland.com> <40eb41eb$1@newsgroups.borland.com> <40eb8d7b$1@newsgroups.borland.com> Subject: Re: Last trie Date: Wed, 7 Jul 2004 13:25:18 -0300 Lines: 66 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 200.213.49.155 Message-ID: <40ec23f0@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089217520 200.213.49.155 (7 Jul 2004 09:25:20 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail