Bug in TMail [Fixed]

Bug in TMail [Fixed]

Postby Enrico Maria Giordano » Tue Feb 27, 2018 11:04 am

In TMail, method Activate, there is

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
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TMail

Postby Antonio Linares » Tue Feb 27, 2018 7:57 pm

How to retrieve the current path when it is a network one ? :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in TMail

Postby Rick Lipkin » Tue Feb 27, 2018 9:18 pm

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 )
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Bug in TMail

Postby Enrico Maria Giordano » Tue Feb 27, 2018 9:48 pm

Antonio Linares wrote:How to retrieve the current path when it is a network one ? :-)


Something like:

Code: Select all  Expand view  RUN
IF CurDrive() = "\"
    cCurPath = CurDir()
ELSE
    cCurPath = CurDrive() + "
:\" + CurDir()
ENDIF


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TMail

Postby Enrico Maria Giordano » Tue Feb 27, 2018 9:48 pm

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 )


Better fix TMail.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TMail

Postby Antonio Linares » Wed Feb 28, 2018 8:40 am

Enrico,

Here you have your changes, please try them :-)

Included for FWH 18.02

Code: Select all  Expand view  RUN
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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in TMail

Postby Enrico Maria Giordano » Thu Mar 01, 2018 7:56 am

It doesn't work. This is look as the right way:

Code: Select all  Expand view  RUN
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


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in TMail

Postby Antonio Linares » Thu Mar 01, 2018 10:23 am

many thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to Bugs report & fixes / Informe de errores y arreglos

Who is online

Users browsing this forum: No registered users and 3 guests