Jump to content

[Closed] IE.au3, _IECreate fails when called in a SendMessage Function


 Share

Recommended Posts

Here is my main code

#include <IE.au3>
GUIRegisterMsg(0x9997, '_IE')
Opt('WinTitleMatchMode', 2 )
local $iebars

$TaskBarGUI=GUICreate('', '', '', '', 960, 1230)

While 1
sleep(250)
Wend

Func _IE($handle, $msgID, $wParam, $lParam)
$iebars=_IECreate('about:blank')
WinSetState('Explorer','',@SW_MAXIMIZE)
_IENavigate ($iebars, 'www.bbciplayer.co.uk',0)
EndFunc

Here is my secondary exe

#include <SendMessage.au3>
#NoTrayIcon

$var = WinList("[Class:AutoIt v3 GUI]")
for $i = 1 to $var[0][0]
if $var[$i][0] = "" Then
_SendMessage($var[$i][1], 0x9997, "", "")
EndIf
Next

sleep(1000)

If WinExists("[Class:IEFrame]") Then
Exit
Else
run("C:\Program Files (x86)\Internet Explorer\iexplore.exe")
EndIf

So i run the main exe, i then run the secondary exe i get this error message

--> IE.au3 V2.4-0 Error from function _IECreate (Browser Object Creation Failed)

--> IE.au3 V2.4-0 Error from function _IENavigate, $_IEStatus_InvalidDataType

I am not sure why i get this error message, as the code that creates the IE is used elsewhere within the main script without issues so i dont see why it suddenly produces a error message when put inside a function? The variables and .au3 are being declared outside the function so i am confused :)

Edited by IanN1990
Link to comment
Share on other sites

  • 1 year later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...