Jump to content

Recommended Posts

  • Moderators
Posted

The next stable version will be released when, and only when, Jon feels comfortable doing so. You could always ask "what can I do to help?" rather than "When am I going to get a new version?" ;)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

  • Developers
Posted

 

@Jos

Don't use the Errorhandler in this way as this is already done internally in the IE functions.
Read the IE.au3 code and look at line 329 - 343.  Line 343 is giving the error now.

Throwing an error to determine if it is a browser type...?. :thumbsdown:

Lines 337 to 353 should be replaced by this single line

If $o_window.name = "Windows-Explorer" Then ContinueLoop

Hey ... I only gave you the reason for your problem which you also could have figured out by spending a little time/effort.

I am not doing the development on the UDF so no need to address me nor thumbdown on the observation. ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

@Jos

Sorry for the missunderstanding.  :x

Thanks for the time to debug. :thumbsup:

I changed the IE.au3 file and my problem in my original scrript is solved.

Thanks again :thumbsup:  :bye:  :ILA2:

App: Au3toCmd              UDF: _SingleScript()                             

Posted (edited)

It's impossible to say what's causing the error without seeing the code you run.

However, AutoIt shouldn't ever error out that way. It's strong indicator of internal bug.

 

Google is your friend: The error number -1073741819 in hex is 0xC0000005 which indicates an access violation in windows.

When you are just using internal functions this could be a bug or are you doing DLL stuff?

Jos

 

I found where is the problem with "AutoIt3.exe ended.rc:-1073741819"

Global $oErrorHandler = ObjEvent("AutoIt.Error", "_AutoIt_MyErrFunc")

Global $ADODBHandle
For $i = 1 To 100
    _ADOClose_test()
Next

Func _ADOClose_test($ADODBHandle = -1)
    If $ADODBHandle.State = 1 Then

    EndIf
EndFunc   ;==>_ADOClose_test


Func _AutoIt_MyErrFunc()
    ; Com Error Handler
    Local $sError_log = ""
    $sError_log &= "$oErrorHandler.number is: " & @TAB & $oErrorHandler.number & @CRLF
    $sError_log &= "$oErrorHandler.windescription:" & @TAB & $oErrorHandler.windescription & @CRLF
    $sError_log &= "$oErrorHandler.description is: " & @TAB & $oErrorHandler.description & @CRLF
    $sError_log &= "$oErrorHandler.source is: " & @TAB & $oErrorHandler.source & @CRLF
    $sError_log &= "$oErrorHandler.helpfile is: " & @TAB & $oErrorHandler.helpfile & @CRLF
    $sError_log &= "$oErrorHandler.helpcontext is: " & @TAB & $oErrorHandler.helpcontext & @CRLF
    $sError_log &= "$oErrorHandler.lastdllerror is: " & @TAB & $oErrorHandler.lastdllerror & @CRLF
    $sError_log &= "$oErrorHandler.scriptline is: " & @TAB & $oErrorHandler.scriptline & @CRLF
    $sError_log &= "$oErrorHandler.retcode is: " & @TAB & $oErrorHandler.retcode & @CRLF & @CRLF
    ConsoleWrite($sError_log)
    Return
EndFunc   ;==>_AutoIt_MyErrFunc

I know that this code may look strange, but this is the shortest version of the reproductive script that in version 3.3.8.1 works correctly, and in version 3.3.9.22 returns an error that says:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "L:\TOOLs\Macro\TEST_BETA.au3" /UserParams    
+>00:51:26 Starting AutoIt3Wrapper v.2.1.3.0 SciTE v.3.3.6.0 ;  Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0415  Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (3.3.9.22)  from:C:\Program Files (x86)\AutoIt3\Beta
+>00:51:26 AU3Check ended.rc:0
>Running:(3.3.9.22):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "L:\TOOLs\Macro\TEST_BETA.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
$oErrorHandler.number is:   169
$oErrorHandler.windescription:  Variable must be of type 'Object'.
$oErrorHandler.description is:  
$oErrorHandler.source is:   
$oErrorHandler.helpfile is:     
$oErrorHandler.helpcontext is:  
$oErrorHandler.lastdllerror is:     0
$oErrorHandler.scriptline is:   9
$oErrorHandler.retcode is:  

!>00:51:31 AutoIt3.exe ended.rc:-1073741819
>Exit code: -1073741819    Time: 5.135

EDIT:

Please give any suggestion or comments to this problem.

mlipok

Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted (edited)
Nice to hear such an optimistic message.
 
And by the way.
It seems to me that some time ago, I had another problem with a similar message.
As soon as I notice it again I'll try to locate it and of course I'll send repro code.
 
 
Best regards
mlipok

 

EDIT:
Track Ticket: #2541

Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted

 

Track Ticket: #2541

It's not loop related issue. It's more general thing related to expression evaluation of non-oneliners that include particular type of tokens associated with dot-accessible variants where the parsing is terminated instead of simply continued which leads to internal stack corruption when COM error handler is active.

...Really sounds more complicated than it is, the fix is trivial.

♡♡♡

.

eMyvnE

Posted
Really nice to hear.
 
By the way, in reference to the name of Track Ticket.
I do not have your knowledge so I used the description that is associated with the way in which I got the error.
 
But thanks for the explanation, because for me, opened the curtain of the old forgotten secret;)
 
 
@trancexx
thanks again
 
 
ps.
The only low-level language that I knew, it was the Motorola 68000 assembler, but that was a long time ago (20 years ago). I never learned to program in C.
Even five years ago, I did not have a need or opportunity to explore the intricacies of the system and its API.
So sometimes incompetently, but I hope that the positive result, butting my two cents.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted

 

- Fixed #2171: TCPTimeout inconsistent.

 

I'm still experiencing a problem with TCP timeouts. Prior to this beta release, the issue was worse. However, I still on occasion get the following output from _FFLoadWait:

_FFLoadWait: ........
__FFWaitForRepl ==> Error TCPSend / TCPRecv: TCPRecv :-1

Here's some code for testing purposes. It doesn't occur every time when running the beta, but I don't recall ever seeing the timeout on the release version.

#AutoIt3Wrapper_Version=Beta

#include <FF.au3>

If _FFConnect(Default, Default, 3000) Then
    ; open a page
    _FFOpenURL("http://ff-au3-example.thorsten-willert.de/")
    Sleep(3000)
    ; disconnect from FireFox
    _FFDisConnect()
Else
    MsgBox(64, "", "Can't connect to FireFox!")
EndIf
Posted

@danp2

FF.au3 is not a standard UDF. but if the probem come from as for TCPConnect timemout ,

THa's not what the #2171 solves.

this fix just fix tha fact that the TCPTimeout value for other TCP functions was not correct when using subsecond values

Posted (edited)

don't know if i should report this since in 3.3.9.22 all ok, but i did not find it on bugtracker or forum, so maybe bug still hiding somewhere...

3.3.8.1. issues:

_ArrayDelete() do not return new array size

This script will crash with error "-1073741819" if $n = 53 or greater. Its ok if $ < 53.

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
$avArray[0] = 53
$avArray[0] = 53
!>22:51:12 AutoIt3.exe ended.rc:-1073741819
>Exit code: -1073741819    Time: 0.451
#include <Array.au3>

$n = 54
Local $avArray[$n]

For $i = 1 To $n-1
    $avArray[$i] = "fhjghjghkg"
Next
$avArray[0] = $n-1
Local $i = 1
Do
    ConsoleWrite("$avArray[0] = "&$avArray[0]&@CRLF)
    $avArray[0] =_ArrayDelete($avArray,$i) -1
Until $i = $avArray[0]

Edited by Iczer
Posted

If it's fixed in the latest beta then no need to report.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

  • Administrators
Posted

It's not loop related issue. It's more general thing related to expression evaluation of non-oneliners that include particular type of tokens associated with dot-accessible variants where the parsing is terminated instead of simply continued which leads to internal stack corruption when COM error handler is active.

...Really sounds more complicated than it is, the fix is trivial.

 

Bit trickier to fix than I initially thought. The problem is that when you try and do an object operation on a non-object the code currently calls an error handler and then tries to continue. I first tried to fix it with that in mind but it's not that easy.  On a single line function call like " $nonObject.Function()" you can get away with calling the error handler and then continuing on the next line with no great problem. But when the failure is on any other sort of line or expression then I can't see a way to continue. For example:

If $nonObject.Prop <> 1 Then
; Do something critical
EndIf

When this fails the error handler is called and we've got a function that can "skip" the bad expression (up to <> in this example ).  But there's no way to know what to do next. Do you assume the comparison was true or false? That's just for a simple If statement, never mind a nested set of Ifs/Loops. It's the sort of situation where only a try/catch type syntax would help.

I've currently got the source setup so that when this situation occurs, the error handler is called and then the script aborts with a fatal error. As the variable is not even an object I'm not entirely sure that the object error handler _should_ be called. It's an object-like operation, but not an object. And the error handler can't do anything to fix the problem which makes me think it's not helping in this case anyway.

Posted (edited)

Bit trickier to fix than I initially thought. The problem is that when you try and do an object operation on a non-object the code currently calls an error handler and then tries to continue. I first tried to fix it with that in mind but it's not that easy.  On a single line function call like " $nonObject.Function()" you can get away with calling the error handler and then continuing on the next line with no great problem. But when the failure is on any other sort of line or expression then I can't see a way to continue. For example:

If $nonObject.Prop <> 1 Then
; Do something critical
EndIf
When this fails the error handler is called and we've got a function that can "skip" the bad expression (up to <> in this example ).  But there's no way to know what to do next. Do you assume the comparison was true or false?

False of course, if possible. Even though it should really be documented as undefined (left side is the value of $nonObject variable for real).

Considering this:

I've currently got the source setup so that when this situation occurs, the error handler is called and then the script aborts with a fatal error. As the variable is not even an object I'm not entirely sure that the object error handler _should_ be called. It's an object-like operation, but not an object. And the error handler can't do anything to fix the problem which makes me think it's not helping in this case anyway.

...maybe you forgot that @error is set.

 

Global $oErrorHandler = ObjEvent("AutoIt.Error", _ErrFunc)
Func _ErrFunc($oError)
;~     MsgBox(4096, "COM error", _
;~          "err.number is: " & @TAB & $oError.number & @CRLF & _
;~             "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
;~             "err.description is: " & @TAB & $oError.description & @CRLF & _
;~             "err.source is: " & @TAB & $oError.source & @CRLF & _
;~             "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
;~             "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
;~             "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
;~             "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
;~             "err.codeline is: " & @TAB & $oError.codeline & @CRLF & _
;~             "err.retcode is: " & @TAB & $oError.retcode)
EndFunc


Local $vVar, $x = 11

If $vVar.Something() Then $x = 23 ; for example

If @error Then ConsoleWrite("The error is: " & @error & @CRLF)
 

That code should print 169 just like this one:

Global $oErrorHandler = ObjEvent("AutoIt.Error", _ErrFunc)
Func _ErrFunc($oError)
;~     MsgBox(4096, "COM error", _
;~          "err.number is: " & @TAB & $oError.number & @CRLF & _
;~             "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
;~             "err.description is: " & @TAB & $oError.description & @CRLF & _
;~             "err.source is: " & @TAB & $oError.source & @CRLF & _
;~             "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
;~             "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
;~             "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
;~             "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
;~             "err.codeline is: " & @TAB & $oError.codeline & @CRLF & _
;~             "err.retcode is: " & @TAB & $oError.retcode)
EndFunc


Local $vVar, $x = 11

If $vVar.Something() Then
    $x = 23 ; for example
EndIf

If @error Then ConsoleWrite("The error is: " & @error & @CRLF)
At least that was the idea. Otherwise why would this work (try it with beta):

Global $oErrorHandler = ObjEvent("AutoIt.Error", _ErrFunc)
Func _ErrFunc($oError)
;~     MsgBox(4096, "COM error", _
;~          "err.number is: " & @TAB & $oError.number & @CRLF & _
;~             "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
;~             "err.description is: " & @TAB & $oError.description & @CRLF & _
;~             "err.source is: " & @TAB & $oError.source & @CRLF & _
;~             "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
;~             "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
;~             "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
;~             "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
;~             "err.codeline is: " & @TAB & $oError.codeline & @CRLF & _
;~             "err.retcode is: " & @TAB & $oError.retcode)
EndFunc


Local $vVar

$vVar.Something()

If @error Then ConsoleWrite("The error is: " & @error & @CRLF)
If I remember correctly we (devs) talked about this already many moons ago. Haug. Edited by trancexx

♡♡♡

.

eMyvnE

Posted

Ok, I think I understand the behaviour. Try the attached.

Something like that, yes.

I see you are pushing 0 on top of the stack. I meant False literally, answering your question about <>1. S_FALSE (1) is more correct to return than 0 (S_OK).

S_FALSE in COM means "no error in execution but check out the documentation for what really happened".

♡♡♡

.

eMyvnE

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...