- Code: Select all Expand view RUN
- cCurPath = CurDrive() + ":\" + CurDir()
But this doesn't work when the current path is a network one (ie. \\myserver\myfolder).
EMG
cCurPath = CurDrive() + ":\" + CurDir()
// where .exe started from is default directory //
cFILE := GetModuleFileName( GetInstance() )
nSTART := RAT( "\", cFILE )
cDEFA := SUBSTR(cFILE,1,nSTART-1)
SET DEFA to ( cDEFA )
Antonio Linares wrote:How to retrieve the current path when it is a network one ?
IF CurDrive() = "\"
cCurPath = CurDir()
ELSE
cCurPath = CurDrive() + ":\" + CurDir()
ENDIF
Rick Lipkin wrote:Enrico
This code is not especially elegant .. and it assumes the .exe is located in the drive or unc you wish to resolve.
Rick Lipkin
- Code: Select all Expand view RUN
// where .exe started from is default directory //
cFILE := GetModuleFileName( GetInstance() )
nSTART := RAT( "\", cFILE )
cDEFA := SUBSTR(cFILE,1,nSTART-1)
SET DEFA to ( cDEFA )
METHOD Activate() CLASS TMail
local cCurPath
if ::nRetCode != -1
IF CurDrive() = "\"
cCurPath = CurDir()
ELSE
cCurPath = CurDrive() + ":\" + CurDir()
ENDIF
::nRetCode = MAPISendMail( ::cSubject, ::cNoteText, ::cMsgType,;
DToS( ::dDate ) + " " + ::cTime,;
::cConversationID, ::lReceipt, ::lFromUser,;
::aOrigin, ::aRecipients, ::aFiles )
lChDir( cCurPath )
else
MsgStop( "Error initializing mail" )
endif
return nil
METHOD Activate() CLASS TMail
local cCurPath
// ::nRetCode = MAPILogOn()
if ::nRetCode != -1
if CurDrive() = "\"
cCurPath = "\" + CurDir()
else
cCurPath = CurDrive() + ":\" + CurDir()
endif
::nRetCode = MAPISendMail( ::cSubject, ::cNoteText, ::cMsgType,;
DToS( ::dDate ) + " " + ::cTime,;
::cConversationID, ::lReceipt, ::lFromUser,;
::aOrigin, ::aRecipients, ::aFiles )
lChDir( cCurPath )
else
MsgStop( "Error initializing mail" )
endif
return nil
Return to Bugs report & fixes / Informe de errores y arreglos
Users browsing this forum: No registered users and 3 guests