Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetSystemDirectory
Message
De
07/12/1999 14:28:00
 
 
À
07/12/1999 14:16:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00299923
Message ID:
00299933
Vues:
15
>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)
>

The DECLARE is wrong - you need to use:

DECLARE INTEGER GetSystemDirectory IN KERNEL32 STRING @buffer, INTEGER nBufSize

The size of the directory path is significantly smaller than 1024 - 512 hytes or 524 bytes seem to stick with me. There's an entry in the FAQ showing code that works for this call under Win32 and Other APIs.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform