I changed my errsysw.prg a little bit, so that the error.log is automatically mailed to me if a customer gets an error.
To do this, I use this code :
- Code: Select all Expand view
TRY
oOutLook := CreateObject("Outlook.Application")
EmSend := .T.
CATCH
TRY
oOutLook := CreateObject("Outlook.Application")
EmSend := .T.
CATCH
EmSend := .F.
END
END
TRY
IF EmSend
oMail := oOutLook:CreateItem(olMailItem)
oMail:Subject := ALLTRIM("Juda(32)-foutmelding - " + ALLTRIM(PAR->GKANTOOR))
oMail:Body := "Datum : " + DTOC(DATE()) + CRLF + "Uur : " + TIME()
oMail:Recipients:Add("info@ma-consult.be")
oMail:Attachments:Add("Error.log")
oMail:Send()
MsgAlert("Error.log has been send !!!","Error")
ENDIF
CATCH
EmSend := .F.
END
CLOSE ALL
SET RESOURCES TO
ErrorLevel( 1 )
QUIT
If I use this function, it always ends with :
Premature Array/Object Release detected 013440ec (the closing number changes each time)
I remarked (*) all the lines, starting with "oMail:", but the error still occurs. But if I also remark (*) the lines with "CreateObject()", the error does not occur.
What does this error mean ?
How can this problem be solved ?
Thanks a lot in advance for any help.