Jump to content
Sign in to follow this  

Problem with _IECreate()

Recommended Posts


Hello everyone!


First, I apologize for my English, I do my best!


I'm posting a topic here, because I have a problem with _IECreate().

I developed a program that allows to automatically authenticate an user to an hotspot. The script checks to a specified interval (every 10 seconds) if the user is logged in or not and for that, I use _IECreate ().


The problem is : The Internet Explorer window is supposed to be hidden for the user convenience, but unfortunately, sometimes she appears for no reason, while $ f_visible is set to 0, as shown in the documentation (I have Internet Explorer 10 & Windows 7). And what's more, when this happens, the window opens several times (because of the interval of 10 seconds) when it should not, because $ f_tryAttach is set to 1.


Maybe _IEErrorHandlerRegister is the cause of the problem, to be honest I do not really know how it works. The basic idea was to get more informations in case of problems.


I come here hoping to find help, because I'm racking my brains to find the source of the problem, but I can't find anything conclusive.


Thank you all for reading, here's is a simple example of how it work.



#include <IE.au3>

$oIEErrorHandler = ObjEvent("AutoIt.Error","MyErrFunc")
$Begin = TimerInit()

While 1

   If TimerDiff($Begin) > 10000 Then
      $Begin = TimerInit()


Func AutoLogin()

; -----------------------------------------------------------

$Visibility = 0                               ; Window visibility (0 : Hidden / 1 : Visible)
$Url = "http://www.wikipedia.org/"            ; TEST Url
$oIE = _IECreate($Url, 1, $Visibility, 1, 1)


Func MyErrFunc($oIEErrorHandler)

    Local $HexNumber
    Local $strMsg

    $HexNumber = Hex($oIEErrorHandler.Number, 8)
    $strMsg = "Error Number: " & $HexNumber & @CRLF
    $strMsg &= "WinDescription: " & $oIEErrorHandler.WinDescription & @CRLF
    $strMsg &= "Script Line: " & $oIEErrorHandler.ScriptLine & @CRLF
    MsgBox(0, "ERROR", $strMsg)

Edited by Shiinrei

Share this post

Link to post
Share on other sites

 # Problem solved by using _IECreateEmbedded() instead of _IECreate():bye:

Share this post

Link to post
Share on other sites

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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.