Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning Drive Information
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00184270
Message ID:
00184290
Vues:
16
>hi,
>try to search on M$ KNOWLEDGE BASE : ID Q135818
>u may also use Win32api
>
>I got the sample as th following:
> DECLARE INTEGER GetLogicalDriveStrings IN Win32API as getit;
> INTEGER nBuffSize, STRING lpString
> CLEAR
> DIMENSION aMyarray(1)
> lpString=SPACE(200)
> nBuffSize=LEN(lpString)
> =getit(nBuffSize,@lpString)
> NumberOfDrives=OCCURS(":",lpString)
> DIMENSION aMyarray(NumberOfDrives)
> FOR i=1 TO NumberOfDrives
> aMyarray(i)=SUBSTR(lpString,AT(":",lpString,i)-1,1)
> ENDFOR

John/Jason,

The GetLogicalDriveStrings function will only return a list of drives available. You will next need to use GetDriveType function, again in Win32API to identify the type of drive. If it returns DRIVE_CDROM, you then have the drive letter of the CDROM. It may be quicker just to scan drives A to Z with this function - need to manually test to see if error occurs on non existent drive. Then stop when you find CD.
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform