Jump to Real's How-to Main page

Get the current directory

First declare
FUNCTION long GetCurrentDirectoryA( long length , ref string path) &
LIBRARY "KERNEL32"
and then
long ll_ret
string ls_path

ls_path = Space(250)
ll_ret = GetCurrentDirectoryA(250, ls_path)
IF ll_ret > 0 THEN
   ls_path = Left(ls_path,ll_ret)
   MessageBoxBox("", ls_path)
ELSE
   Messagebox("Error","Err GetCurrentDirectory " + String(ll_ret))
END IF

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]