Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I determine which drive is the CD ROM drive?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00317538
Message ID:
00317865
Vues:
21
Hi Ramon,

GetLogicalDrives() is fine, I don't think that you need the MOD() statement, however. The the integer that the function returns will provide a map to the drives.

Just as a note, there's also GetLogicalDriveStrings(), which, when used in conjunction with foxtools can do this:
DECLARE INTEGER GetLogicalDriveStrings IN Win32API;
  INTEGER nBufferLength, STRING @lpBuffer
lcbuffer = SPACE(100)
lnsize = LEN(lcbuffer)
IF GetLogicalDriveStrings(lnsize, @lcbuffer) > 0
  lcbuffer = CHRTRAN(lcbuffer, CHR(0), CHR(13))
  lndrives = Words(lcbuffer, CHR(13)) && Get the number of drives
  FOR lni = 1 TO lndrives
    ? DRIVETYPE(WordNum(lcbuffer, lni, CHR(13))
  NEXT
ENDIF
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform