Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetSystemDirectory
Message
From
07/12/1999 14:28:00
 
 
To
07/12/1999 14:16:55
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00299923
Message ID:
00299933
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform