Jump to content
Sign in to follow this  
ACS

_IEAttach bug

Recommended Posts

ACS

First off hello! Forum newbie here. Used AutoIt a few years back, stopped for a while, then started using it again recently and was amazed at the changes that took place since then! (The last time I used AutoIt it was still version 2.)

Anyways, onto my question...

It seems there's a bug with _IEAttach. When I try to call this function by matching the window handle I get an error generated by the include file IE.au3.

#include <IE.au3>

_IE_VersionInfo()

$hwnd = WinGetHandle("about:blank")
If $hwnd == "" Then
    MsgBox(0, "Error", "Couldn't find the window")
    Exit
EndIf
MsgBox(0, "Found window", "Found the window")
_IEAttach($hwnd, "hwnd")

To run the above code just open an Internet Explorer window without any URL, or nagivate to "about:blank".

Here's the response I get.

--> IE.au3 V2.3-1 Information from function _IE_VersionInfo, version V2.3-1 (Release date: 20070813)
c:\AutoIt\Include\IE.au3 (3018) : ==> The requested action with this object has failed.: 
Return HWnd($o_object.HWnd()) 
Return HWnd($o_object.HWnd()^ ERROR

Is this a known bug with _IEAttach or am I just using it incorrectly?

Share this post


Link to post
Share on other sites
Thatsgreat2345

First off hello! Forum newbie here. Used AutoIt a few years back, stopped for a while, then started using it again recently and was amazed at the changes that took place since then! (The last time I used AutoIt it was still version 2.)

Anyways, onto my question...

It seems there's a bug with _IEAttach. When I try to call this function by matching the window handle I get an error generated by the include file IE.au3.

#include <IE.au3>

_IE_VersionInfo()

$hwnd = WinGetHandle("about:blank")
If $hwnd == "" Then
    MsgBox(0, "Error", "Couldn't find the window")
    Exit
EndIf
MsgBox(0, "Found window", "Found the window")
_IEAttach($hwnd, "hwnd")

To run the above code just open an Internet Explorer window without any URL, or nagivate to "about:blank".

Here's the response I get.

--> IE.au3 V2.3-1 Information from function _IE_VersionInfo, version V2.3-1 (Release date: 20070813)
c:\AutoIt\Include\IE.au3 (3018) : ==> The requested action with this object has failed.: 
Return HWnd($o_object.HWnd()) 
Return HWnd($o_object.HWnd()^ ERROR

Is this a known bug with _IEAttach or am I just using it incorrectly?

It works for me, you sure you have the most up to date IE.au3?

Share this post


Link to post
Share on other sites
ACS

It works for me, you sure you have the most up to date IE.au3?

I believe so, I installed AutoIt3 very recently. The version number and build date are there (version V2.3-1 (Release date: 20070813)), I don't know if they're the most recent ones.

I downloaded AutoIt v3.2.10.0 and used the IE.au3 file that was contained within.

Is it possible the self-extracting archive contains an older version than the EXE-install setup file?

Share this post


Link to post
Share on other sites
DaleHohm

Odd. It works for me as well with 2.3-1. Once change for me however, the window title is different - had to change the $hwnd = WinGetHandle("about:blank") to $hwnd = WinGetHandle("Blank Page") or it couldn't find it.

Let me know if the following works for you:

#include <IE.au3>
$oIE = _IECreate()
$hwnd = _IEPropertyGet($oIE, "hwnd")
$oIE2 = _IEAttach($hwnd, "hwnd")

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
ACS

Very, very odd.

Dale: At first when I ran the code it worked fine. Opened up a new IE window and the script ended without any errors.

I modified the code a bit to display the URL as follows, just to ensure the attachment was successful:

MsgBox(0, "URL", _IEPropertyGet($oIE2, "locationurl"))

Ran the code again, got the same message.

So I deleted the new line of code, reverting the script back to its original state. And NOW IT DOESN'T WORK.

I even tried clearing the document and re-copying and pasting your code back in. Still doesn't work.

c:\AutoIt\Include\IE.au3 (3018) : ==> The requested action with this object has failed.: 
Return HWnd($o_object.HWnd()) 
Return HWnd($o_object.HWnd()^ ERROR

Something very strange is going on here...

Share this post


Link to post
Share on other sites
DaleHohm

Inconsistent results with IE are often caused by a zombie iexplore.exe process on your system. Try using Task Manager to kill all of them or logout/reboot to see if the trouble persists.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
ACS

I checked taskman but found no running iexplore processes, but the error still persisted.

So I tried restarting, and that seemed to do the trick, thanks! :)

I wonder though how something like this can be avoided in the future (and for that matter what caused it to begin with.) It would be a real shame to have to reboot every time this problem surfaces.

Share this post


Link to post
Share on other sites
DaleHohm

Call Microsoft. It most certainly is not an AutoIt issue.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
ACS

Alright well it seems I've figured out the problem.

The problem seems to be Steam. If Steam is running when I execute the script, I get that strange error. But as soon as I shut down Steam, the problem goes away! Not sure what's going on there... :)

Could someone else try it out? Run the script in the first post without Steam running, then run Steam and try rerunning the script. Works the first time, not the second. Shut down Steam and it begins working again.

That's very, very odd... I wonder if Steam is setting some kind of system hook that interferes with _IEAttach?

Share this post


Link to post
Share on other sites
PsaltyDS

Alright well it seems I've figured out the problem.

The problem seems to be Steam. If Steam is running when I execute the script, I get that strange error. But as soon as I shut down Steam, the problem goes away! Not sure what's going on there... :(

Could someone else try it out? Run the script in the first post without Steam running, then run Steam and try rerunning the script. Works the first time, not the second. Shut down Steam and it begins working again.

That's very, very odd... I wonder if Steam is setting some kind of system hook that interferes with _IEAttach?

I'm convinced Steam is malware. My son has had nothing but trouble with it for the last two years or so. Only a mild addiction the games involved keeps it on his system, and that seems to be at the cost of letting Valve do horrible things to his system. People should be objecting to Valve's behavior in Steam every bit as loudly as they do about Sony's root kits.

...sorry, I'll step off the soapbox now.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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
Sign in to follow this  

×