Modify

Opened 6 years ago

Closed 6 years ago

#3738 closed Bug (Fixed)

Com error in _IEAttach with embedded IE

Reported by: Nine Owned by: mLipok
Milestone: 3.3.15.4 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 (7)

comment:1 by mLipok, 6 years ago

Description: modified (diff)
Owner: set to mLipok
Status: newassigned

comment:2 by mLipok, 6 years ago

Component: AutoItStandard UDFs

comment:3 by mLipok, 6 years ago

Description: modified (diff)

comment:4 by mLipok, 6 years ago

Description: modified (diff)

comment:5 by mLipok, 6 years ago

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.

Version 0, edited 6 years ago by mLipok (next)

comment:6 by Nine, 6 years ago

Working :)

comment:7 by mLipok, 6 years ago

Milestone: 3.3.15.4
Resolution: Fixed
Status: assignedclosed

Fixed by revision [12331] in version: 3.3.15.4

Modify Ticket

Action
as closed The owner will remain mLipok.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.