[Gambas-user] [CRASH REPORT] CherchMail

Philippe Valarcher philippe.valarcher at free.fr
Sat Mar 11 20:10:49 CET 2023


Hello,

Damned, my program crashed Gambas that way :

Public Function RunPOP(i As Integer) As
String                                  'alimentation des comptes en
mails

   Dim Ligne As Integer, n As Integer, Emails As Integer
   Dim newLast As String, phrase1 As String, phrase2 As String, monText
As String

   Module1.serveurPop(i)
   Try
Module1.POP.Open                                                      
'ouverture de la connexion pop

   Emails = Module1.POP.count

   If Emails > 0 Then
      newLast = Module1.POP[Module1.POP.count - 1].UniqueID
      If newLast > MailRecu[i].theLast Then
         If chkBeep.value Then PlayBeep()
      Endif
      monText =
txtRun.Text                                                ' texte des
notifications
      phrase1 = ("Serveur : ")
      phrase2 = ("Nombre de Courriel(s) : ")
      monText = Replace(monText, "%p1", phrase1)
      monText = Replace(monText, "%p2", phrase2)
      monText = Replace(monText, "%u", Module1.pop.user)
      monText = Replace(monText, "%s", Module1.pop.host)
      monText = Replace(monText, "%m", CStr(emails))
      AddLog(("Nombre de courriels sur le serveur") & " : " & " [ " &
Module1.pop.host & " ] " & " : " & Emails)

      grvw[i].Rows.Count = Module1.POP.Count

      For n = 0 To Emails - 1
         newLast = Module1.POP[n].UniqueID
         tbstp[i + 1].Text = Accounts[i].Nom & " + " &
Module1.POP.Count
         ' grvw[i].Columns.Count = 5

         grvw[i][Ligne, 0].Text = CStr(Module1.POP[n].Message.Sender)
         grvw[i][Ligne, 1].Text = CStr(Module1.POP[n].Message.Subject)
         grvw[i][Ligne, 2].Text = CStr(Module1.POP[n].Message.To)
         grvw[i][Ligne, 3].Text =
CStr(Module1.POP[n].Message.Headers["Date"])
         grvw[i][Ligne, 4].Text = CStr(Module1.POP[n].Size)

         Ligne += 1
         MailRecu[i].index = Module1.POP[n].Index
         nbrMail += 1
      Next

      MailRecu[i].theLast = Module1.POP[Emails - 1].UniqueID
      grvw[i].Tooltip = ("Double-Cliquer sur un message pour le
visionner")

   Else
      tbstp[i + 1].Text = Accounts[i].Nom
      With grvw[i]
         .Clear
         .Refresh
         .Rows.Count = 0
         .Columns.Count = 0
         .Tooltip = ""
      End With
   Endif

   Try Module1.POP.Close
   Try Module1.POP = Null

   Return monText

Catch
   TimeRemain = TimeInterval
   Tray.icon = Picture["./icônes/mail.png"]
   Message.Title = ("Horreur!")
   Message(gb.CrLf & ("Une erreur : ") & " RunPOP " & Error.Text &
gb.CrLf & "Code : " & Error.Code)

End

Public Sub tbstp_MouseDown()

   Module1.son(Module1.shade)

End
Cette fontion provoque une erreur de segmentation, si je commente les
cinq lignes avec grvw[i] ça ne plante pas?

-- 
Philippe Valarcher <philippe.valarcher at free.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230311/ef02cb66/attachment.htm>


More information about the User mailing list