Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call Windows Explorer
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00185851
Message ID:
00185867
Views:
19
>Heres a simple example to fit your needs. Do this in a test:-
>
>DECLARE INTEGER GetWindowsDirectory IN Win32API; && Strict function name
>STRING lcBuffer; && to store the directory name
>INTEGER lnBufSize && to tell function max length
>
>STORE SPACE(100) TO lcBuffer
>GetWindowsDirectory(@lcBuffer,LEN(lcBuffer)
>
>lcBuffer will then contain the windows directory (with null terminator) look for null within the string (LEFT(lcBuffer,AT(CHR(0),lcBuffer)) to get directory.
>

*** You may need to change above to lnResult=GetWindowsDirectory(... then lnResult will contain length of data in lcBuffer (including terminator). It may be easier to then say lcWinDir=LEFT(lcBuffer,lnResult-1) after checking lnResult for non-positive values first (0 or negative=error).
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Reply
Map
View

Click here to load this message in the networking platform