Skip to content

Latest commit

 

History

History
45 lines (30 loc) · 944 Bytes

sample_086.md

File metadata and controls

45 lines (30 loc) · 944 Bytes

Home

Finding the path to the VFP executable running

Code:

DECLARE INTEGER GetModuleHandle IN kernel32;
	INTEGER lpModuleName

DECLARE INTEGER GetModuleFileName IN kernel32;
	INTEGER  hModule,;
	STRING @ lpFilename,;
	INTEGER  nSize

hModule = GetModuleHandle(0)
lpFilename = SPACE(250)

lnLen = GetModuleFileName (hModule, @lpFilename, Len(lpFilename))
? Left (lpFilename, lnLen)  

Listed functions:

GetModuleFileName
GetModuleHandle

Comment:

Depending on OS, VFP version running, and differently for run-time and command window mode you may get various results:

c:\vfp\vfp.exe
c:\winnt\system32\vfp300.esl
c:\Program Files\Microsoft Visual Studio\VFP98\VFP6.Exe
...


? _vfp.servername