홈 · 개발 참고자료

개발 참고자료

[파워빌더] Get the CDROM drive letter

작성자
관리자
작성일
2016-10-16
조회
14768
분류
파워빌더
[Function declarations]
FUNCTION ulong GetLogicalDrives() LIBRARY "Kernel32.dll"
FUNCTION uint GetDriveType( Ref String as_root_path )
LIBRARY "kernel32.dll" ALIAS FOR "GetDriveTypeA"

[PB function String of_GetCDRootPath()]

integer li_ctr
string ls_root
ulong lul_drives, lul_rem

lul_drives = GetLogicalDrives()

DO
lul_rem = MOD(lul_drives, 2)
IF lul_rem = 1 THEN
ls_root = Char(li_ctr + 64) + ":\"
IF GetDriveType(ls_root_path) = 5 THEN
Return ls_root_path
END IF
li_ctr ++
END IF
lul_drives /= 2
LOOP UNTIL lul_drives = 0

RETURN ""