Home Series60 Smartphone Pocket PC PC Omnis
         
 

EXTFunc - TechNote EF0001 (Get CD-ROM Drive Letter)

Variable Name Type Description
POINTER Long Integer Memory pointer for drive strings
POINTER2 Long Integer Memory pointer for drive strings
DRIVEID Character Drive Names
RETURNEDID Character Current Drive Name
CDCONSTANT Long Integer Constant value for CDROM drive type
Get Type Value ("CONST","DRIVE_CDROM") Returns CDCONSTANT
Allocate Type ("String*1024") Returns POINTER
; String populated is a list of null terminated strings (Followed by a null)
Call Function ("GetLogicalDriveStrings",1024,POINTER) 
Get Type Value (POINTER) Returns DRIVEID
Calculate POINTER2 as POINTER
While len(DRIVEID)
    ; Advance to the next string in the list
    Allocate Type ("String",POINTER2+len(DRIVEID)+1) Returns POINTER2
    Get Type Value (POINTER2) Returns DRIVEID
    Free Type (POINTER2)
    Call Function ("GetDriveType",DRIVEID) Returns RETURNEDID
    If RETURNEDID=CDCONSTANT
        OK message {CDROM is path [DRIVEID]}
    End If
End While
Free Type (POINTER)

 

Need help with your particular problem?  Then simply email support