#Region Header ; #HEADER# ======================================================================================================================= ; Title .........: COM Error Handler UDF for AutoIt3 ; AutoIt Version : 3.4.4 ; Language ......: English ; Description ...: Error handler message box for COM/OLE Objects ; Author(s) .....: ; Requirements...: AutoIt v3.3 +, Developed/Tested on Windows 7 64-bit ; using Crystal Reports 11.5.12.1838 and Crystal Reports and Crystal Reports Runtime 11 ; =============================================================================================================================== #EndRegion Header ; Initialize error handler Global $oError = ObjEvent("AutoIt.Error","_ErrorHandler") ; Error handler Func _ErrorHandler() $hexCode=hex($oError.number,8) Msgbox(0,"COM Error","COM error received!" & @CRLF & @CRLF & _ "err.description: " & @TAB & $oError.description & @CRLF & _ "err.windescription: " & @TAB & $oError.windescription & @CRLF & _ "err.number: " & @TAB & $hexCode & @CRLF & _ "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ "err.source: " & @TAB & $oError.source & @CRLF & _ "err.helpfile: " & @TAB & $oError.helpfile & @CRLF & _ "err.helpcontext: " & @TAB & $oError.helpcontext _ ) SetError(1) Endfunc