Article View: borland.public.cppbuilder.nativeapi
Article #10327Re: GetVolumeInformation Problem
From: Ed Mulroy [TeamB]
Date: Sun, 25 Apr 2004 01:34
Date: Sun, 25 Apr 2004 01:34
27 lines
1805 bytes
1805 bytes
That looks like it will work so the answer is 'yes and no'.
The number should be correct but nobody should know that since disk
serial numbers are almost always shown in hex and the method used
below will show it in decimal.
. Ed
> LarryJ wrote in message
> news:408aea19@newsgroups.borland.com...
>
> If I replace the IntToStr() with the AnsiString() and use the
> unsigned long volser inside the AnsiString() function as seen
> below, will this display the correct volume serial number in
> the Edit box?
>
> int rc=0;
> AnsiString CompNum;
> char volname[VOLNAMESIZE];
> unsigned long volser=0;
>
> rc = GetVolumeInformation("C:\\", (char *)&volname,
> VOLNAMESIZE, &volser,
> NULL, NULL, NULL, 0);
> CompNum = AnsiString(volser);
> Form2->Edit1->Text = CompNum;
Technical Details
Message-ID:
<408b15bb@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<408ae02c$1@newsgroups.borland.com> <408ae5f7$1@newsgroups.borland.com> <408aea19@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c24bbdaaf95607e1 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-24 18:39:27 PST From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <408ae02c$1@newsgroups.borland.com> <408ae5f7$1@newsgroups.borland.com> <408aea19@newsgroups.borland.com> Subject: Re: GetVolumeInformation Problem Date: Sat, 24 Apr 2004 21:34:45 -0400 Lines: 29 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: 209.170.140.58 Message-ID: <408b15bb@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1082856891 209.170.140.58 (24 Apr 2004 18:34:51 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail