[..] Erreur de IE.au3 étrange

Aide et conseils concernant AutoIt et ses outils.
Règles du forum
.
Répondre
GMib
Niveau 4
Niveau 4
Messages : 57
Enregistré le : sam. 23 janv. 2010 12:39
Status : Hors ligne

[..] Erreur de IE.au3 étrange

#1

Message par GMib »

Bonjour, je cherche depuis plusieurs jour a comprendre pourquoi j'ai cette erreur :

Code : Tout sélectionner

C:\Program Files\AutoIt3\Include\IE.au3 (3754) : ==> Variable must be of type "Object".:
$IEComErrorScriptline = $oIEErrorHandler.scriptline
$IEComErrorScriptline = $oIEErrorHandler^ ERROR
voici le code :

Code : Tout sélectionner

#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <IE.au3>
Global $editsyn,$htmlfilter

creategui()
Func creategui()
    Opt("GUIOnEventMode", 1)
    $form1 = GUICreate("Vidz", 715, 207, 500, 500, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOOLWINDOW)
    $editsyn = _IECreateEmbedded()
    $hCtrl = GUICtrlCreateObj($editsyn, 0, 0, 715, 207)
    _IENavigate ($editsyn, "about&#058;Synopsis")
    GUISetState(@SW_SHOW)
    While 1
        disp()
        Sleep(1000)
    WEnd
EndFunc   ;==>creategui

Func disp()
    $line = '<head><style type="text/css">' & _
    'body {height:200px;width:690px;margin:0;padding:0;} html {margin:0;padding:0;} #imagette img {height:196px;margin-top:1px;margin-left:1px;float:left;border:1px solid black;margin-right:3px;} .left{float:left;}' & _
    '.right {margin:0;padding:0;float:right;text-align:right;} #header {margin-bottom:5px;} #annee {font-size:120%;font-weight:bold;margin-right:5px;} #titre {font-weight: bold; } #synopsis {font-size:80%;} </style>' & _
    '</head><body><div id="imagette"><a href="pickclick|[image]"><img src="[image]"/></a></div><div id="header"><div class="right"><div>[rea]</div><div><a href="rechfilm">Rech Film</a> - <a href="rechinfo">Rech info</a></div></div>' & _
    '<div id="titregen"><span id="annee">[annee]</span><span id="titre"><a href="titreclick">[titre]</a></span></div><div id="genre">[genre]</div></div><div id="synopsis">[synopsis]</div></body></html>'
    _IEDocWriteHTML($editsyn, $line)
    _IEAction ($editsyn, "refresh")
    $oLinks = _IELinkGetCollection($editsyn)
    For $oLink in $oLinks
        $sLinkId = _IEPropertyGet($oLink, "uniqueid")
        _IEHeadInsertEventScript($editsyn, $sLinkId, "onclick", "return false;")
        ObjEvent($oLink, "_Evt_")
    Next
EndFunc   ;==>disp

Func _Evt_onClick()
    Local $o_link = @COM_EventObj
    Select
        Case StringInStr($o_link.href,'about&#058;pickclick|')
            test($o_link.href)
    EndSelect
EndFunc

Func test($link)
    $oIE = _IECreate ("http://www.autoitscript.com/")
    _IEDocWriteHTML ($oIE, "about&#058;blank")
    _IEAction ($oIE, "refresh")
EndFunc
l'erreur se produit quand je fait appel a IE.au3 dans des fonctions séparés, peu importe la fonction appellé (_IECreate, _IEDocWriteHTML etc...)
Si toutes les fonctions faisant appel a IE.au3 sont contenu dans la fonction disp() je n'est pas d'erreur.

Si quelqu'un a une solution, merci d'avance ;)
Avatar du membre
timmalos
Niveau 11
Niveau 11
Messages : 1970
Enregistré le : dim. 18 mai 2008 15:16
Status : Hors ligne

Re: [..] Erreur de IE.au3 étrange

#2

Message par timmalos »

J'avais deja rencontré ce probleme mais je n'ai aucune idée de comment la resoudre.
Répondre