Article View: borland.public.cppbuilder.nativeapi
Article #9163Re: How do i know if drive is ready
From: Andrue Cope [TeamB]
Date: Thu, 29 Jul 2004 08:18
Date: Thu, 29 Jul 2004 08:18
33 lines
1874 bytes
1874 bytes
This is what we use.
// Now get the volume name (if we can)
{
// Turn off system error dialog
UINT storedErrorMode=SetErrorMode( SEM_FAILCRITICALERRORS );
char volName[ 255 ]; // Should be enough for most people
if( GetVolumeInformation( chAdd,
volName, sizeof( volName ),
NULL, NULL, NULL, NULL, 0 ) )
{
driveInfo.Name=new char[ strlen( chAdd )+3+
strlen( volName )+1 ];
sprintf( driveInfo.Name,
"%s (%s)",
volName,
chAdd );
}
else
{ // Some 'at went wrong - just use the drive letter
driveInfo.Name=new char[ strlen( chAdd )+1 ];
strcpy( driveInfo.Name, chAdd );
}
SetErrorMode( storedErrorMode );
}
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<4108b2e6$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4107f700$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2b9eb20deef104af X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Andrue Cope [TeamB]" <no.spam@spammy.com> Subject: Re: How do i know if drive is ready Newsgroups: borland.public.cppbuilder.nativeapi References: <4107f700$1@newsgroups.borland.com> User-Agent: XanaNews/1.16.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 217.207.223.34 Message-ID: <4108b2e6$1@newsgroups.borland.com> Date: 29 Jul 2004 01:18:46 -0700 X-Trace: newsgroups.borland.com 1091089126 217.207.223.34 (29 Jul 2004 01:18:46 -0700) Lines: 33 X-Authenticated-User: acope Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail