Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Attaching Files
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows 2000
Database:
MS SQL Server
Miscellaneous
Thread ID:
01121739
Message ID:
01121992
Views:
9
>Thanx Vladmir for your reply
>i saw the wnetgetuniversalname api
>but can u give me a example how to use the following code given on that site
>
>
>DECLARE INTEGER WNetGetUniversalName IN mpr;
>    STRING    lpLocalPath,;
>    INTEGER   dwInfoLevel,;
>    STRING  @ lpBuffer,;
>    INTEGER @ lpBufferSize
>
>
>Thanx


Riyaz,
Try this
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
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform