Jump to content
Sign in to follow this  
pdaughe

IE8

Recommended Posts

pdaughe

Hi,

I installed IE8 and an existing application which uses IE.AU3 (attaching to an embedded IE) now fails.

If you are running IE8, could you please run the following script?

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <IE.au3>
AutoItSetOption ('MustDeclareVars', 1);Require explicit variable declaration
AutoItSetOption ('WinTitleMatchMode', 2);Match any substring in title

Local $Title = StringStripWS (InputBox ("IE Attach Test", "Enter title"), 3)

Local $Handle =  WinGetHandle ($Title)

If Not $Handle Then
   MsgBox ($MB_ICONEXCLAMATION + $MB_TOPMOST, "IE Attach", $Title & " window not found.")
   Exit
EndIf

Local $oIE = _IEAttach ($Title, "Embedded")
If @error Then
   MsgBox ($MB_ICONEXCLAMATION + $MB_TOPMOST, "IE Attach", "Unable to attach to " & $Title)
   Exit
Else
   MsgBox ($MB_ICONEXCLAMATION + $MB_TOPMOST, "IE Attach", "Successful attach to " & $Title)
EndIf

$oIE = 0

1. Open the AutoIt Help file, run the script, and type in "AutoIt Help" (case sensitive). The IEAttach should be successful.

2. Open Windows Mail (Vista) or Outlook Express (XP). Show the Preview pane. Run this script, type in "Windows Mail" or "Outlook" and see if the IEAttach is successful.

3. Post your results.

Thank you in advance!

Share this post


Link to post
Share on other sites
DaleHohm

I simplified your code to this:

#AutoIt3Wrapper_Run_Debug_Mode=Y
#include <IE.au3>

_IEErrorHandlerRegister()

If IsObj(_IEAttach ("AutoIt Help", "Embedded")) Then ConsoleWrite("Success" & @CRLF)
If IsObj(_IEAttach ("Windows Mail", "Embedded")) Then ConsoleWrite("Success" & @CRLF)

and got the following (with Windows Mail and the AutoIt Help file running)

!> Starting in DebugMode..
Line: @error-@extended: Line syntax
0001: 0-0: #AutoIt3Wrapper_Run_Debug_Mode=Y
0002: 0-0: #include <IE.au3>
0004: 0-0: _IEErrorHandlerRegister()
0006: 0-0: If IsObj(_IEAttach ("AutoIt Help", "Embedded")) Then ConsoleWrite("Success" & @CRLF)
Success
0007: 0-0: If IsObj(_IEAttach ("Windows Mail", "Embedded")) Then ConsoleWrite("Success" & @CRLF)
--> COM Error Encountered in tmp-create_DebugIt.au3
----> $IEComErrorScriptline = 4198
----> $IEComErrorNumberHex = 80020009
----> $IEComErrorNumber = -2147352567
----> $IEComErrorWinDescription = Access is denied.
----> $IEComErrorDescription = Access is denied.
----> $IEComErrorSource = 
----> $IEComErrorHelpFile = C:\Windows\system32\mshtml.hlp
----> $IEComErrorHelpContext = 0
----> $IEComErrorLastDllError = 0

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

+>09:11:58 AutoIT3.exe ended.rc:0

Windows Mail does have an embedded control:

>>>> Control <<<<
Class:  Internet Explorer_Server
Instance:   1
ClassnameNN:    Internet Explorer_Server1
Advanced (Class):   [CLASS:Internet Explorer_Server; INSTANCE:1]

The Access is Denied error suggests taht something has changed about the Windows Mail design rather than IE.au3, if this worked in previous versions. This it the type of error typical to cross-domain scripting secutiry for frames in a typical browser.

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
pdaughe

I simplified your code to this:

#AutoIt3Wrapper_Run_Debug_Mode=Y
#include <IE.au3>

_IEErrorHandlerRegister()

If IsObj(_IEAttach ("AutoIt Help", "Embedded")) Then ConsoleWrite("Success" & @CRLF)
If IsObj(_IEAttach ("Windows Mail", "Embedded")) Then ConsoleWrite("Success" & @CRLF)

and got the following (with Windows Mail and the AutoIt Help file running)

!> Starting in DebugMode..
Line: @error-@extended: Line syntax
0001: 0-0: #AutoIt3Wrapper_Run_Debug_Mode=Y
0002: 0-0: #include <IE.au3>
0004: 0-0: _IEErrorHandlerRegister()
0006: 0-0: If IsObj(_IEAttach ("AutoIt Help", "Embedded")) Then ConsoleWrite("Success" & @CRLF)
Success
0007: 0-0: If IsObj(_IEAttach ("Windows Mail", "Embedded")) Then ConsoleWrite("Success" & @CRLF)
--> COM Error Encountered in tmp-create_DebugIt.au3
----> $IEComErrorScriptline = 4198
----> $IEComErrorNumberHex = 80020009
----> $IEComErrorNumber = -2147352567
----> $IEComErrorWinDescription = Access is denied.
----> $IEComErrorDescription = Access is denied.
----> $IEComErrorSource = 
----> $IEComErrorHelpFile = C:\Windows\system32\mshtml.hlp
----> $IEComErrorHelpContext = 0
----> $IEComErrorLastDllError = 0

--> IE.au3 V2.4-0 Warning from function _IEAttach, $_IEStatus_NoMatch

+>09:11:58 AutoIT3.exe ended.rc:0

Windows Mail does have an embedded control:

>>>> Control <<<<
Class:  Internet Explorer_Server
Instance:   1
ClassnameNN:    Internet Explorer_Server1
Advanced (Class):   [CLASS:Internet Explorer_Server; INSTANCE:1]

The Access is Denied error suggests taht something has changed about the Windows Mail design rather than IE.au3, if this worked in previous versions. This it the type of error typical to cross-domain scripting secutiry for frames in a typical browser.

Dale

Thanks Dale for testing this. I question, though, the certainty of your conclusion. I do not believe it is due to a change in Windows Mail design itself for three reasons:

1. I have several users running the application under Vista, INCLUDING MYSELF, where the attach always works, as I have stated, under IE7. Admittedly, when IE8 was installed on my Vista machine, I didn't review the other updates to see if updates were applied to Windows Mail as well. However...

2. I have confirmed that if you install IE8 on XP, the example script I supplied demonstrates that _IEAttach no longer works with OutLook Express. It does with IE7. My confirmation ensured the only change was the install of IE8. This should certainly be easy enough for you to verify.

3. Remember, my issue was NOT with Windows Mail or Outlook Express, but a corporate application using an embedded IE server. The corporate application did not change.

I think all we can say with certainty is that IE8 functions, for perhaps reasons not presently fully understood, differently as an embedded control than IE7 did. Although most-likey related to security as you suggested, it is definitely not Vista's UIPI as I had suspicioned since the problem does indeed manifest itself on XP with IE8. That is in fact why I suggested Windows Help as an example. Here, for whatever reason, we are able to attach to an EMBEDDED IE, even with IE8.

It may be helpful to others to note that existing IE.au3 based applications may fail when IE8 is installed.

I was able to provide a (temporary) work-around to IE8 users of my application by using SendMessage to send specific command ids to the embedded IE Server control. However, I haven't found a reliable way to test whether the server is busy or not, without actually doing the attach (the temporary work-around just does a sleep after the SendMessage, and is apparently working fine, but may incurr problems when people log into the application from home). Do you have any suggestions on how to tell if the IE server is busy without doing an attach?

There is an activeX control available (vbMHWB.DLL) to "externalize" the methods of the WebBrowser control, which I will be

testing today. Do you have any experience with that?

Thanks again for your help.

Paul

Share this post


Link to post
Share on other sites
DaleHohm

I just tested with XP, IE8 and Outlook Express and _IEAttach worked fine.

As stated, I tested with Vista, IE8 and Windows Mail an it failed with Access Denied.

I just tested with Vista, IE7 and Windows Live Mail and it failed with Access Denied just as it did with Vista and IE8 with Windows Mail.

So, I am not yet convinced that there is a systemic issue with IE8 here.

I'm afraid there are too many moving parts at this time to support the conclusions you have made thus far. It is going to take some more controlled tests to verify what has changed in your environment that is the root cause for you.

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

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  

×