CodePudding user response:
Define the Global variablesString gs_apppath
Define the Global external functions provides
The FUNCTION ulong GetModuleFileName (ulong hModule, ref string lpFileName, ulong nSize) LIBRARY "kernel32. DLL" ALIAS FOR "GetModuleFileNameA
"
Create a global function gs_getapppath
String ls_dir
String ls_path
Ls_dir=Space (256)
GetModuleFileName (0, ls_dir, 256)
The Environment E_nv
Int li_PBversion
Int I
GetEnvironment (E_nv)
Li_PBversion=E_nv. PBMajorRevision
IF Pos (ls_dir, "pb80. Exe") & gt; 0 THEN//pb80. Exe refers to pb development tool exe file name
Ls_path=GetCurrentDirectory ()
The ELSE
For I=len (ls_dir) to step 1-1
If Mid (ls_dir, I, 1)='\' Then Exit
Next
Ls_path=Left (ls_dir, I - 1)
END the IF
Return ls_path + ""
In the event of an application of the open
Gs_apppath=gs_getapppath ()
Got your current executable file path, on a visit to the external exe was no problem, such as exe in the test folder, then path is gs_apppath + test \ ""
CodePudding user response:
Thank spring_cj, I'll be going to give it a try, don't know to ask you again! Thank you very much! I am a novice, the good will move! So quickly back to the post!CodePudding user response:
The app open event program in the current directory saved to a global variableGs_path=GetCurrentDirectory ()
Such as the bb. Exe aa folder under the current directory, the path is
Gs_path + '/aa/bb. Exe' the