Jump to content

Recommended Posts

Posted (edited)

I use Windows 7 32-bit, Internet Explorer 11, Autoit 3.3.14.0

in this script have error after 100 or 300 passes

Error screen http://clip2net.com/s/3ldQuPM

#include <IE.au3>

$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")  
$i=0
While 1
    $i=$i+1
    TrayTip("", $i, 9999)

    $oIE = _IECreate()
    _IENavigate($oIE, "https://www.ixbt.com", 0)
    _IELoadWait($oIE, 0, 90000)
   
    $v_pole = _IEGetObjById($oIE, 'custom-confirmation')   
    _IEAction($v_pole, "focus")
    Sleep(1000)
    ProcessClose("iexplore.exe")   
WEnd

In old version Autoit when used IEErrorHandlerRegister() all work fine!

This is a bag in autoit or I do something wrong in my code ?

 

 
Edited by Melba23
Added code tags and amended title
Posted (edited)

Welcome to Autoit and the forum!

This script looks a bit strange to me. Why do you create and end IE in a loop? Why do you process the same page over and over again?
Can you please tell us what you try to achieve with this script?

Edited by water

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted (edited)

water

This script just for example to show you the problem

I test it on many copmuters with IE11 and in all of them I have this problem

In Ie8 i cant repeat the problem but its very old brouser

Edited by nill
  • Moderators
Posted

nill,

When you post code please use Code tags - see here how to do it.  Then you get a scrolling box and syntax colouring as you can see above now I have added the tags.

M23

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

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

@nill

Where you declare

 

Func MyErrFunc()
.....
EndFunc

 

??

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Melba23

ok i dont known that

mLipok

my MyErrFunc in the same file

Func MyErrFunc()
    $err_text = "err.description is: " & @TAB & $oMyError.description & _
            "err.windescription:" & @TAB & $oMyError.windescription  & _
            "err.number is: " & @TAB & Hex($oMyError.number, 8)  & _
            "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror  & _
            "err.scriptline is: " & @TAB & $oMyError.scriptline  & _
            "err.source is: " & @TAB & $oMyError.source  & _
            "err.helpfile is: " & @TAB & $oMyError.helpfile  & _
            "err.helpcontext is: " & @TAB & $oMyError.helpcontext _

    ;MsgBox(4096,"COM Error", $ErrorOutput)
    ConsoleWrite($err_text & @CRLF)
    SetError(1)
    Return
EndFunc   ;==>MyErrFunc

 

Edited by nill
Posted

And do you still go the sam problem ?

 

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

The problem occcurs because of this line 

If IsObj($oObject.document.getElementById($sID)) Then

inside:

Func _IEGetObjById(ByRef $oObject, $sID)
....
EndFunc   ;==>_IEGetObjById

 

 

Normally this line does not generate any error.
But after, one of the order calling appears:

  Reveal hidden contents

 

--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (custom-confirmation)
! 63
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (custom-confirmation)
! 64
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (custom-confirmation)
! 65
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (custom-confirmation)
! 66
--> COM Error encountered in test_IE_Crash.au3 (1999) :
----> $IEComErrorNumber            = 0x80020008 (-2147352568)
----> $IEComErrorWinDescription    = Zły typ zmiennej.
----> $IEComErrorDescription       = 
----> $IEComErrorSource            = 
----> $IEComErrorHelpFile          = 
----> $IEComErrorHelpContext       = 
----> $IEComErrorLastDllError      = 0
----> $IEComErrorRetcode           = 0x00000000
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (custom-confirmation)
! 67
--> COM Error encountered in test_IE_Crash.au3 (1999) :
----> $IEComErrorNumber            = 0x80020008 (-2147352568)
----> $IEComErrorWinDescription    = Zły typ zmiennej.
----> $IEComErrorDescription       = 
----> $IEComErrorSource            = 
----> $IEComErrorHelpFile          = 
----> $IEComErrorHelpContext       = 
----> $IEComErrorLastDllError      = 0
----> $IEComErrorRetcode           = 0x00000000
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (custom-confirmation)
! 68
--> COM Error encountered in test_IE_Crash.au3 (1999) :
----> $IEComErrorNumber            = 0x80020008 (-2147352568)
----> $IEComErrorWinDescription    = Zły typ zmiennej.
----> $IEComErrorDescription       = 
----> $IEComErrorSource            = 
----> $IEComErrorHelpFile          = 
----> $IEComErrorHelpContext       = 
----> $IEComErrorLastDllError      = 0
----> $IEComErrorRetcode           = 0x00000000
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (custom-confirmation)
! 69
--> COM Error encountered in test_IE_Crash.au3 (1999) :
----> $IEComErrorNumber            = 0x80020008 (-2147352568)
----> $IEComErrorWinDescription    = Zły typ zmiennej.
----> $IEComErrorDescription       = 
----> $IEComErrorSource            = 
----> $IEComErrorHelpFile          = 
----> $IEComErrorHelpContext       = 
----> $IEComErrorLastDllError      = 0
----> $IEComErrorRetcode           = 0x00000000
--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (custom-confirmation)
! 70
!>12:18:13 AutoIt3.exe ended.rc:-1073741819
+>12:18:13 AutoIt3Wrapper Finished.
>Exit code: 3221225477    Time: 352.2

EDIT: Zły typ zmiennej == the wrong type of variable

 

 

Edited by mLipok
spoiler added

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

here is my repro code:

 

#include <IE.au3>
#include <WinAPIError.au3>

$oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
MsgBox(0, '@error', @error)

_Example(1)

Func _Example($iWait)
    Local $iCounter = 0
    Local $oIE, $o_pole
    $oIE = _IECreate()

    While 1
        $iCounter += 1
        ConsoleWrite("! " & $iCounter & @CRLF)

        _IENavigate($oIE, "google.com", $iWait )
        $o_pole = _IEGetObjById($oIE, 'custom-confirmation')
    WEnd

    _IEQuit($oIE)

EndFunc   ;==>_Example

Func MyErrFunc($oError)
    ConsoleWrite("--> " & __COMErrorFormating($oError, "----> $IEComError") & @CRLF)
    Return 1
EndFunc   ;==>_ErrFunc

 

As you can see this is not realted to multiple using 

While 1 
    $oIE = _IECreate()
    ...
    _IEQuit($oIE)
Wend

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

mLipok

Ok i understand you idea

but If I want to close brouser what can I do in code ?

maybe not very often but I need sometimes close brouser when script working

Posted

Close ? or Hide ?

_IEQuit($oIE)

btw.

https://www.autoitscript.com/trac/autoit/ticket/3097

 

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 7/28/2015 at 5:16 AM, nill said:

_IEErrorHandlerRegister() but its not supported in new versions autoit

Did you try on Au3.3.14.0 ??

 

 

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

It was removed. And even 3.3.12.0 do not support this function.

but I ask again:

  On 7/28/2015 at 7:34 AM, mLipok said:

Did you try on Au3.3.14.0 ??

 

; #NO_DOC_FUNCTION# =============================================================================================================
; Name...........: _IEErrorHandlerRegister
; Description ...: Register and enable a user COM error handler
; Parameters ....: $sFunctionName - String variable with the name of a user-defined COM error handler
;                                     defaults to the internal COM error handler in this UDF
; Return values .: On Success   - Returns 1
;                  On Failure   - Returns 0 and sets @error
;                   @error      - 0 ($_IEStatus_Success) = No Error
;                               - 1 ($_IEStatus_GeneralError) = General Error
;                   @extended   - Contains invalid parameter number
; Author ........: Dale Hohm
; ===============================================================================================================================
Func _IEErrorHandlerRegister($sFunctionName = "__IEInternalErrorHandler")
    $__g_oIEErrorHandler = ObjEvent("AutoIt.Error", $sFunctionName)
    If IsObj($__g_oIEErrorHandler) Then
        $__g_sIEUserErrorHandler = $sFunctionName
        Return SetError($_IESTATUS_Success, 0, 1)
    Else
        $__g_oIEErrorHandler = ""
        __IEConsoleWriteError("Error", "_IEErrorHandlerRegister", "$_IEStatus_GeneralError", _
                "Error Handler Not Registered - Check existance of error function")
        Return SetError($_IEStatus_GeneralError, 1, 0)
    EndIf
EndFunc   ;==>_IEErrorHandlerRegister

; #NO_DOC_FUNCTION# =============================================================================================================
; Name...........: _IEErrorHandlerDeRegister
; Description ...: Disable a registered user COM error handler
; Parameters ....: None
; Return values .: On Success   - Returns 1
;                  On Failure   - None
; Author ........: Dale Hohm
; ===============================================================================================================================
Func _IEErrorHandlerDeRegister()
    $__g_sIEUserErrorHandler = ""
    $__g_oIEErrorHandler = ""
    Return SetError($_IESTATUS_Success, 0, 1)
EndFunc   ;==>_IEErrorHandlerDeRegister

 

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

mLipok

sorry my mistake 3.3.14.0 with _IEErrorHandlerRegister

But after test I can confirm autoit cant work with IE11

I try your code, try to use _IEErrorHandlerRegister or $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

AutoIt always crash!

in IE8 all work fine!

for my understanding helps only new autoit version ?

 

 
 
 
 
  • 2 months later...
Posted (edited)

After some more research I finally find this:

https://github.com/enthought/comtypes/issues/66

http://permalink.gmane.org/gmane.comp.python.comtypes.user/616

Looks like IE Object related problem  -- Quite possible this is DevEnvironment Independend.
More for OS arch related problem.

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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