Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetSystemDirectory
Message
De
07/12/1999 14:33:37
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00299923
Message ID:
00299937
Vues:
16
Thanks for the help, George! Much appreciated!


Rod Poujade
Montreal, Canada

>>Hi,
>>
>> I tried to find something in VFP that returns the Windows system directory (System or System32, depending), and gave up so I tried the following:
>>
>>Declare GetSystemDirectory in kernel32 String,Integer
>>lcBuffer = SPACE(1024)
>>? GetSystemDirectory(@lcBuffer,1024)
>>
>>Seems to work, but the call returns .T. rather than the length of the string returned. Since I'm new at the API stuff, can someone tell me if the usage above is correct? And is there a native VFP (some GetEnv call or other) to get the System directory?
>>
>>Thanks,
>>
>Hi Rod
>
>You didn't declare the return data type as INTEGER. Here's the modification:
DECLARE INTEGER GetSystemDirectory IN Win32API;
>  STRING @lpbuffer, INTEGER dwsize
>lcbuffer = SPACE(260)
>lnsize = LEN(lcbuffer)
>? GetSystemDirectory(@lcbuffer, lnsize)
Note that I've limited the size of the buffer to 260 characters, which is the current length of MAX_PATH.
Rod Poujade
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform