>DECLARE INTEGER WNetGetUniversalName IN mpr; > STRING lpLocalPath,; > INTEGER dwInfoLevel,; > STRING @ lpBuffer,; > INTEGER @ lpBufferSize >>
m.YourPathWithMap = GetFile(...) IF .NOT. EMPTY(m.YourPathWithMap) m.UncName = GetUnc(LEFT(m.YourPathWithMap,2)) m.YourPathWithUnc = m.UncName + SUBSTR(m.YourPathWithMap,3) ... ELSE ... ENDIF FUNCTION GetUnc LPARAMETER cDriveLetterToCheck DECLARE INTEGER WNetGetConnection IN Win32API ; STRING @cLocalDrive, ; STRING @cRemoteUNCBuffer, ; INTEGER @nSizeOfBuffer cBuffer = SPACE(511) nResult = WNetGetConnection(cDriveLetterToCheck, ; @cBuffer, ; 511) IF nResult # 0 *** Failed - it's probably not a mapped drive, *** or nothing is mapped to it RETURN '' ELSE RETURN LEFT(cBuffer,AT(CHR(0),cBuffer)-1) ENDIF