Modify

Opened 8 days ago

Last modified 10 hours ago

#3738 assigned Bug

Com error in _IEAttach with embedded IE

Reported by: Nine Owned by: mLipok
Milestone: Component: Standard UDFs
Version: 3.3.14.5 Severity: None
Keywords: Cc:

Description (last modified by mLipok)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 580)
GUICtrlCreateObj($oIE, 10, 40, 600, 360)
GUISetState()
_IENavigate ($oIE, "http://www.autoitscript.com")
$oIEatt = _IEAttach ("Embedded","embedded")
MsgBox ($MB_SYSTEMMODAL,"",IsObj ($oIEatt))
$oObj = _IETagNameGetCollection ($oIEatt, "li")
MsgBox ($MB_SYSTEMMODAL,"",$oObj.length)

While 1
        Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                        ExitLoop
        EndSwitch
WEnd

Ends up with a COM error :

"C:\Program Files (x86)\AutoIt3\Include\IE.au3" (3066) : ==> The requested action with this object has failed.:
Return $oIE.Document.parentwindow
Return $oIE.Document ERROR

But if you remove .Document.parentwindow from the Func IEControlGetObjFromHWND () it works fine...

Attachments (0)

Change History (6)

comment:1 Changed 5 days ago by mLipok

  • Description modified (diff)
  • Owner set to mLipok
  • Status changed from new to assigned

comment:2 Changed 5 days ago by mLipok

  • Component changed from AutoIt to Standard UDFs

comment:3 Changed 5 days ago by mLipok

  • Description modified (diff)

comment:4 Changed 5 days ago by mLipok

  • Description modified (diff)

comment:5 Changed 13 hours ago by mLipok

There is many work done in IE.au3 UDF in the background, which stuck because of documenting, given changes.

To solve this problem please try to change in function:

__IEControlGetObjFromHWND()

this last few lines in the following way:

        If IsObj($aRet[4]) Then
                Local $oIE = $aRet[4].Script()
                ; $oIE is now a valid IDispatch object
                If ObjName($oIE, $OBJ_NAME) = 'HTMLWindow2' Then Return $oIE
                Local $oDocument = $oIE.Document
                If @error then Return SetError(@error, @extended, 0)
                Return $oDocument.parentwindow
        Else
                Return SetError(1, $aRet[0], 0)
        EndIf
EndFunc   ;==>__IEControlGetObjFromHWND

And back with results.

Last edited 13 hours ago by mLipok (previous) (diff)

comment:6 Changed 10 hours ago by Nine

Working :)

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as assigned The owner will remain mLipok.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.