Use GetModuleFileName API call to find the location your executable, since App.Path can return erro
Use GetModuleFileName API call to find the location your executable, since App.Path can return erroneous results.
API Declarations
Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Public Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Rate Use GetModuleFileName API call to find the location your executable, since App.Path can return erro
(2(2 Vote))
'Try using GetModuleFileName API call to avoid the problem
Dim lngFileHandle As Long
Dim lngReturn As Long
Dim strFilePath As String
strFilePath = Space$(MAX_PATH)
lngFileHandle = GetModuleHandle(App.EXEName)
lngReturn = GetModuleFileName(lngFileHandle, strFilePath, MAX_PATH)
MsgBox strFilePath
Use GetModuleFileName API call to find the location your executable, since App.Path can return erro Comments
No comments yet — be the first to post one!
Post a Comment