Jump to content

Recommended Posts

Posted (edited)

Hey All,

I seem to have an issue with _IEAttach. Here is the code.

Local $winTitle1 = "Interface Search - " ; name of page
Local $winTitle2 = "Interface Details - "; name of page
If WinExists($winTitle1) Then
    $Hwnd = WinGetHandle($winTitle1)    
    $oIE = _IEAttach($hwnd, "HWND") ; This line of code causes the error            
ElseIf WinExists($winTitle2) Then
    $Hwnd = WinGetHandle($winTitle2)
    $oIE = _IEAttach($hwnd, "HWND")
    
Else
    
    $oIE = _IECreate($LoginURL, 0, 1)
EndIf

This is the error I'm getting.

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "E:\AutoIT\Work Scripts\Haystacks\HayStackst.au3"

C:\Program Files\AutoIt3\Include\ie.au3 (2674) : ==> The requested action with this object has failed.:

Return SetError($_IEStatus_Success, 0, HWnd($o_object.HWnd()))

Return SetError($_IEStatus_Success, 0, HWnd($o_object.HWnd()^ ERROR

>Exit code: 1 Time: 0.987

Any help is appreciated.

Thanks

Edited by Steveiwonder

They call me MrRegExpMan

Posted

ok i managed to get it to work by change my code to this.

It seems there is some problem when im using HWND to attach to the window.

$oIE = ""
    Local $winTitle1 = "Interface Search - " ; name of page
    Local $winTitle2 = "Interface Details - "; name of page
    If WinExists($winTitle1) Then
        ;$hwnd = WinGetHandle($winTitle1)       
        $oIE = _IEAttach($winTitle1, "WindowTitle")         
    ElseIf WinExists($winTitle2) Then
        ;$hwnd = WinGetHandle($winTitle2)
        $oIE = _IEAttach($winTitle2, "WindowTitle")     
    Else
        
        $oIE = _IECreate($LoginURL, 0, 1)
    EndIf

Anyone explain?

They call me MrRegExpMan

Posted

What is special about the browser instance you are attaching to? It probably means it is not a standard browser window. Would need a reproducer.

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

Posted

Dale,

There isn't anything special about the browser window i'm using, AFAIK. This only started after i updated to the latest version.

If i was using the code that causes the error i would have to reboot my PC to stop it, the error would reoccur after a few times of running the script.

No idea what causes it, but its not an issue as i'm using a different method now.

I don't know its its a bug in autoit somewhere or not but np for me now.

They call me MrRegExpMan

  • 2 weeks later...
Posted

I don't know its its a bug in autoit somewhere or not but np for me now.

I'm getting the exact same error. I'm running my script (which uses _IEAttach in the same way) on XP and Windows 7. Works fine on XP w/ IE7. Breaks with the same error message on Windows 7 (64-bit) w/ IE8. The error seems to be non-fatal, so my workaround is simply to use _IEErrFunc to pause, ignore it, and return.

Posted (edited)

Same as Dale said before, can you post a short runnable script that will reproduce your symptoms? Without some code to look at, this is just Psychic Script-Whisperer stuff.

:mellow:

Edited by PsaltyDS
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
  • 1 year later...
Posted

Strangely I didn't have this behaviour until today. I wrote a script that attached to my browser and worked fine just the last few weeks. Today it went nuts so I came along this thread and another one as well. I posted my solution over Might this "patch" probably make it's way into a next release of AutoIt?

This funny error only seems to occur on open IE windows not being a TopLevelContainer. I just check out for this.

Posted

Might this "patch" probably make it's way into a next release of AutoIt?

Would make sense, I think... best to add a BugTrac for this though...

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

  • 5 weeks later...
Posted

The bug report is entered, but there is still no reproducer. I won't be comfortable adding a 'fix' for something I cannot test.

Can you create or find a scenario where you can reproduce this?

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

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
  • Recently Browsing   0 members

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