Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any VFP 7 like version of GETDIR() for VFP 6?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00724840
Message ID:
01185956
Vues:
20
>>>Let me preface this with the following points:
>>>1. I have to use Visual FoxPro 6.0 (SP 5)
>>>2. I know GETDIR() in Visual FoxPro 7.0 has what I want
>>
>>>I would like to have a function (either User Defined Function, API call, ActiveX, wrapper, etc.) that I could use instead of the Visual FoxPro 6.0 GETDIR() function to retrieve a directory/folder path name that will allow the user to create a folder "on-the-fly" via the dialog box when necessary. I know that there is one in Windows (Copy/Move To displays this one). I just cannot seem to find the API name/call/define for it.
>>
>>You can try this:
>>--- How can I use GETDIR with a network drive? ---
>>--- Alex Feldstein ---
>>http://www.feldstein.net/netgetdir.asp
>>
>>Hope this Help.
>
>Esparta,
>
>Thanks a lot. Do you know how can I make GetDir to return UNC path instead of the actual drive name? I could not find all the flags for SHBrowseForFolder function in MSDN as Help file suggests, so I don't know if a flag exists.
>
>Thanks a lot in advance.

Hi Naomi
See if this help
CLEAR
? GetUnc([K:])
RETURN

FUNCTION GetUnc(lcMapedDevice)
DECLARE INTEGER WNetGetConnection IN Win32API ;
   STRING   @cLocalDrive, ;
   STRING   @cRemoteUNCBuffer, ;
   INTEGER  @nSizeOfBuffer
cBuffer = SPACE(511)
nResult = WNetGetConnection(lcMapedDevice, ;
                            @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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform