Faran

multi Ie keep crashing

4 posts in this topic

hello,

I am running 4 OLE sometimes they work very fine but sometimes they keep giving me these error and apps doesn work after these errors

--> IE.au3 T3.0-1 Error from function _IEPropertyGet, $_IESTATUS_InvalidValue (Invalid Property)
--> IE.au3 T3.0-1 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023174, Browser has been deleted prior to operation.)
--> IE.au3 T3.0-1 Error from function _IEPropertyGet, $_IESTATUS_InvalidObjectType
--> IE.au3 T3.0-1 Error from function _IETagNameGetCollection, $_IESTATUS_InvalidObjectType

how to resolve this issue

thanks

Share this post


Link to post
Share on other sites



Please, post your code so that we may have a look. :)


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

here are complete code

using SciTE-Lite  Version 3.4.1

Ie version 11.0.9600.17280

#include <IE.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <Array.au3>
#Include <GuiListView.au3>
#include <File.au3>
#include <GUIListBox.au3>
#Region ### START Koda GUI section ### Form=c:\users\sajid\documents\form1.kxf
$Form1_1 = GUICreate("Form1", 428, 206, 192, 124)
$uid = GUICtrlCreateInput("", 152, 32, 121, 21)
$max = GUICtrlCreateInput("", 152, 64, 121, 21)
$loginb = GUICtrlCreateButton("LOGIN", 16, 144, 75, 25)
$buyb = GUICtrlCreateButton("BUY NOW", 152, 88, 75, 25)
$Button3 = GUICtrlCreateButton("STOP", 232, 88, 75, 25)
$List1 =  GUICtrlCreateListView("Username|Password", 280, 100, 150, 250, BitOR($LBS_MULTIPLESEL,$LBS_MULTICOLUMN,$LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT))
$Label1 = GUICtrlCreateLabel("PET UID", 96, 32, 47, 17)
$Label2 = GUICtrlCreateLabel("MAX VALUE", 80, 64, 65, 17)
GUISetState(@SW_SHOW)
Local $pid,$pid2, $hHandle, $hGUI,$hGUI2, $sURL, $xHeight, $xWidth
#EndRegion ### END Koda GUI section ###
If @error Then
    If @error = 2 Then ProcessClose(@extended)
    Exit 1
 EndIf


        $file = "users.txt"
For $i = 1 to _FileCountLines($file)
      $line = FileReadLine($file, $i)
GUICtrlCreateListViewItem($line,$List1)

Next

While 1
        ;After every loop check if the user clicked something in the GUI window
        $iMsg = GUIGetMsg()
        Select
         Case $iMsg = $GUI_EVENT_CLOSE
                ;Destroy the GUI including the controls
                GUIDelete()
                ;Exit the script
                Exit
            ;Check if user clicked on the close button

         Case $iMsg = $loginb

Global $oIE = _IEInPrivateCreate("www.google.com", 2)
sleep(500)
 $selected = _GUICtrlListView_GetSelectedIndices($List1)
$seprate = StringSplit($selected,"|")
$count = _GUICtrlListView_GetSelectedCount($List1)
MsgBox(0, "Tage", $count)






$login = filereadline($file,$seprate[1]+1)

$string = stringsplit($login,"|")
            _IENavigate($oIE, "mysite")
                        _IELoadWait($oIE)
       ;loop through elements and get the names of the text fields for user and pass
 Local $tags = _IETagNameGetCollection($oIE, "input")

$o_login = $oIE.document.getElementById("username")
$o_password = $oIE.document.getElementById("password")
$o_signin = $oIE.document.getElementById("signInBtn")

$username = $string[1]
$password = $string[2]

_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_signin, "click")
Sleep(2000)
if $count > 1 Then
 Global $oIE2 = _IEInPrivateCreate("www.google.com", 2)
sleep(500)
$login = filereadline($file,$seprate[2]+1)
$string = stringsplit($login,"|")

            _IENavigate($oIE2, "mysite")
                        _IELoadWait($oIE2)
       ;loop through elements and get the names of the text fields for user and pass
 Local $tags = _IETagNameGetCollection($oIE2, "input")

$o_login = $oIE2.document.getElementById("username")
$o_password = $oIE2.document.getElementById("password")
$o_signin = $oIE2.document.getElementById("signInBtn")

$username = $string[1]
$password = $string[2]

_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_signin, "click")
EndIf

if $count >2  Then
 Global $oIE3 = _IEInPrivateCreate("www.google.com", 2)
sleep(500)
$login = filereadline($file,$seprate[3]+1)
$string = stringsplit($login,"|")

            _IENavigate($oIE3, "mysite")
                        _IELoadWait($oIE3)
       ;loop through elements and get the names of the text fields for user and pass
 Local $tags = _IETagNameGetCollection($oIE3, "input")

$o_login = $oIE3.document.getElementById("username")
$o_password = $oIE3.document.getElementById("password")
$o_signin = $oIE3.document.getElementById("signInBtn")

$username = $string[1]
$password = $string[2]

_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_signin, "click")
EndIf


if $count >3  Then
Global $oIE4 = _IEInPrivateCreate("www.google.com", 2)
sleep(500)
$login = filereadline($file,$seprate[4]+1)
$string = stringsplit($login,"|")

            _IENavigate($oIE4, "mysite")
                        _IELoadWait($oIE4)
       ;loop through elements and get the names of the text fields for user and pass
 Local $tags = _IETagNameGetCollection($oIE4, "input")

$o_login = $oIE4.document.getElementById("username")
$o_password = $oIE4.document.getElementById("password")
$o_signin = $oIE4.document.getElementById("signInBtn")

$username = $string[1]
$password = $string[2]

_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)

_IEAction ($o_signin, "click")
EndIf
 Case $iMsg = $buyb
            $count = _GUICtrlListView_GetSelectedCount($List1)
            $uid2 = "mysite"
            $uid3 = GUICtrlRead($uid)
            $uid4 = $uid2&$uid3
        _IENavigate($oIE, $uid4)
_IELoadWait($oIE)
$oAs = _IETagnameGetCollection($oIE, "a")
for $oA in $oAs
 If StringInStr($oA.innertext, "mytext") Then
  _IEAction($oA, "click")
  ExitLoop
   EndIf
Next
$oAs =""
sleep(500)
if $count > 1 Then
   _IENavigate($oIE2, $uid4)
_IELoadWait($oIE2)
   $oAs2 = _IETagnameGetCollection($oIE2, "a")
for $oA2 in $oAs2
 If StringInStr($oA2.innertext, "mytext") Then
  _IEAction($oA2, "click")
  ExitLoop
   EndIf
Next
   endIf
      sleep(500)

   if $count > 2 Then
      _IENavigate($oIE3, $uid4)
_IELoadWait($oIE3)
      $oAs3 = _IETagnameGetCollection($oIE3, "a")
for $oA3 in $oAs3
 If StringInStr($oA3.innertext, "mytext") Then
  _IEAction($oA3, "click")
  ExitLoop
   EndIf
Next
   EndIf
   sleep(500)
      if $count > 3 Then
      _IENavigate($oIE4, $uid4)
_IELoadWait($oIE4)
      $oAs4 = _IETagnameGetCollection($oIE4, "a")
for $oA4 in $oAs4
 If StringInStr($oA4.innertext, "mytext") Then
  _IEAction($oA4, "click")
  ExitLoop
   EndIf
Next
      EndIf


        EndSelect

    WEnd



Func _IEInPrivateCreate($s_url, $i_timeout = -1) ; Simple version, you can add all the other stuff if you like ($i_timeout is in secs).
    Local $s_random = "about:InPrivate " & Random(1000000, 99999999, 1) & "-" & Random(1000000, 99999999, 1)
    If $s_url = "" Then $s_url = "about:InPrivate"

     Local $i_pid = Run('"' & @ProgramFilesDir & '\Internet Explorer\iexplore.exe" -private -nomerge "' & $s_random & '"')
    If $i_pid = 0 Then Return SetError(1, 0, 0)

    If StringInStr("|default|-1|", "|" & $i_timeout & "|") Then $i_timeout = 0

    Local $h_wnd, $o_shell, $o_shell_wins, $i_timer

    If $i_timeout > 0 Then $i_timer = TimerInit()
    While 1

        If $i_timeout And TimerDiff($i_timer) / 1000 > $i_timeout Then
            Return SetError(2, $i_pid, 0)
        EndIf

        $h_wnd = WinGetHandle($s_random)
        If $h_wnd Then ExitLoop
        Sleep(10)
    WEnd

    $o_shell = ObjCreate("Shell.Application")
    If IsObj($o_shell) Then
        $o_shell_wins = $o_shell.Windows

        For $o_shell_win In $o_shell_wins
            ; IE.au3 checks for IWebBrowser as well as IWebBrowser2 with __IEIsObjType
            ; This fails with my outlook with "hwnd" property
            ; So if its 100% neccessary, you'll need to find a work around
            If String(ObjName($o_shell_win)) = "IWebBrowser2" Then
                If $o_shell_win.hwnd = $h_wnd Then
                    Return SetError(0, $i_pid, $o_shell_win)
                EndIf
            EndIf
        Next
    EndIf

    Return SetError(3, $i_pid, 0)
EndFunc

Share this post


Link to post
Share on other sites

between i posted at wrong section i guess moderator please move my topic is right

if this is right >>>>General Help and Support <<<<<

thanks

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