Jump to content
Sign in to follow this  
pootie tang

Problem with IEAttach and embedded IE control

Recommended Posts

pootie tang

I am trying to use IEAttach to the IE instance that is embedded in the IE window. When it gets to the appropriate IEAttach call, it dies in a lower level function with the following error:

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

Return $oIE.document.parentwindow

Return $oIE.Document^ ERROR

The info from AU3Info looks like it should be able to attach (based on the description for IEAttach):

>>>> Window <<<<

Title: S3 Application Login Request

Class: #32770

Position: 0, 0

Size: 807, 617

Style: 0x94C800C4

ExStyle: 0x00010101

Handle: 0x004E05BE

>>>> Control <<<<

Class: Internet Explorer_Server

Instance: 1

ClassnameNN: Internet Explorer_Server1

Advanced (Class): [CLASS:Internet Explorer_Server; INSTANCE:1]

ID:

Text:

Position: 11, 11

Size: 780, 533

ControlClick Coords: 258, 264

Style: 0x56000000

ExStyle: 0x00000000

Handle: 0x002B0714

>>>> Mouse <<<<

Position: 272, 297

Cursor ID: 2

Color: 0x67818D

>>>> StatusBar <<<<

>>>> Visible Text <<<<

ﭤі

The web server requires external authentication. Please log in using the form above. After successful login, the connection to your DocuShare server will resume automatically.

>>>> Hidden Text <<<<

Any help would be appreciated. Thanks in advance.

Share this post


Link to post
Share on other sites
pootie tang

Forgot to mention I am running v3.2.12.1

Share this post


Link to post
Share on other sites
DaleHohm

You must include some code.

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
pootie tang

You must include some code.

Dale

Sorry about that. Just a simple call to IEAttach in my case fails.

$oIE = _IEAttach ("S3 Application","embedded")

Looks like inside of IEAttach, it makes a call to __IEControlGetObjFromHWND which is where it fails.

Share this post


Link to post
Share on other sites
pootie tang

Also tried the following code but then got an error in a different function. I tried to get the windows handle for the Internet Explorer_Server object (which was successful) and then use IEAttach using the "hwnd" option to attach. But that causes it to fail in _IEPropertyGet on line 3116:

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

Return HWnd($o_object.HWnd())

Return HWnd($o_object.HWnd()^ ERROR

The sample code I used was:

$handle = ControlGetHandle("S3 Application Login Request","","[Class:Internet Explorer_Server]")

MsgBox(0,'handle',$handle)

$oIE = _IEAttach ($handle,"hwnd")

I also ran WinGetClass on the window that contains the IE control and the result was:

AtlAxWin

Shell Embedding

Shell DocObject View

Internet Explorer_Server

Internet Explorer_TridentCmboBx

Static

Any help or suggestions would be much appreciated

Share this post


Link to post
Share on other sites
DaleHohm

What is displayed in the IE control? IE.au3 works with HTML and HTA documents and the associated DOM. The WebBrowser and InternetExplorer controls support other types of content like FTP and plugins like PDF readers that do not have the same DOM. See if you can create a reproducer if ths is not enough information.

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
pootie tang

What is displayed in the IE control? IE.au3 works with HTML and HTA documents and the associated DOM. The WebBrowser and InternetExplorer controls support other types of content like FTP and plugins like PDF readers that do not have the same DOM. See if you can create a reproducer if ths is not enough information.

Dale

Thanks for the help. As far as the IE control it has a couple of input fields as well a button to login. If am able to view the source for the object:

From the source, it looks like HTML (but I could be wrong). Not sure what you mean "reproducer" Thanks again in advance.

Dave

CODE

<HTML dir='ltr'>

<HEAD>

<TITLE> S3 Application Login Request </TITLE>

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<LINK rel="stylesheet" href="../csslib/styles.css" type="text/css">

<script language="Javascript1.1" src="../jslib/common.js"></SCRIPT>

<script language="Javascript1.1" src="../jslib/password.js"></SCRIPT>

<script LANGUAGE= "Javascript">

<!--

function validate()

{

if ( document.login.USER.value.length > 0 && document.login.PASSWORD.value.length > 0 )

{

document.login.USER.value = document.login.USER.value.toLowerCase();

document.login.submit();

} else

{

alert ('Please enter both a username and password! ');

}

}

//-->

</SCRIPT>

</HEAD>

<BODY bgcolor="#FFFFFF" onload="placeFocus()">

<table class="outsidetable" cellspacing="0" cellpadding="0" bgcolor=""#000000" align="center">

<tr><td>

<table border="0" cellspacing="0" cellpadding="0" width="740" bgcolor="#FFFFFF">

<tr>

<td rowspan="2"><img src="../images/Sdial.gif" alt="" width="100" height="100" border="0"><img src="../images/1x1trans.gif" width="10" height="1" alt="" border="0"></td>

<td valign="bottom" height="70" width="127" class="actionHeader">

APPLICATION LOGIN

<br>&nbsp;

</td>

<td valign="bottom" width="350">

Did you know that S3 was designed to protect against identity theft of personal information at Xerox?<br>Learn

<a href="java script:makeRemoteLarge('../popup/value.jsp')">

more ...

</a>

<br>&nbsp;

</td>

<td rowspan="2" valign="top">

<table border="0" cellspacing="0" cellpadding="0">

<tr>

<td valign="top" align="right"><img src="../images/xsig.gif" alt="The Document Company, Xerox" border="0"></td>

</tr>

<tr>

<td><img src="../images/1x1trans.gif" width="1" height="12" alt="" border="0"></td>

</tr>

<tr>

<td valign="top" align="right">

<form name="language" method="POST" ACTION="">

<select name="language_preference" align="right" onchange="setLanguage()">

<option value="">Language:</option>

<option value="en_US"> English</option>

<option value="fr_CA">Fran&ccedil;ais</option>

<option value="de_DE">Deutsch</option>

<option value="pt_BR">Português Brasileiro</option>

<option value="pt_PT">Portugu&ecirc;s Portugal</option>

<option value="it_IT">Italiano</option>

<option value="es_ES">Español</option>

<option value="he_IL">עברית</option>

<option value="dh_NL">Dutch</option>

</select>

</form>

</td>

</tr>

</table>

</td>

<td rowspan="2"><img src="../images/1x1trans.gif" width="21" height="1" alt="" border="0"></td>

</tr>

<tr>

<td class="breadcrumb" valign="middle" colspan="2" height="1" >

</td>

</tr>

</table>

<table border="0" cellspacing="0" cellpadding="0" width="740" bgcolor="#FFFFFF">

<tr>

<td colspan="4" bgcolor="#000000"><img src="../images/1x1trans.gif" width="1" height="1" alt="" border="0"></td>

<tr>

<td colspan="4" bgcolor="#67818D"><img src="../images/1x1trans.gif" width="1" height="15" alt="" border="0"></td>

</tr>

<tr>

<td colspan="4" bgcolor="#67818D">

<table border="0" cellspacing="0" cellpadding="1" bgcolor="#67818D">

<tr>

<td><img src="../images/1x1trans.gif" width="10" height="1" alt="" border="0"></td>

<td valign="top" class="appinfo" width="250"><img src="../images/1x1trans.gif" width="250" height="1" alt="" border="0"><br>

<!-- Display App Logo -->

<center>

<BR><BR><BR><IMG src="/apps/images/edocushare_new.gif"<br>

<TABLE width='99%' border='0' cellspacing='0' cellpadding='0'><TR> <TD class='appinfo' align='center'><font color='#FFFFFF'><strong>Having Trouble? </strong> <br><A href=java script:makeRemote2('http://www.selfhelp.support.xerox.com')><font color='#FFFFFF'>Click here</font></A> for assistance</TD> </TR> </TABLE>

</center>

</td>

<td><img src="../images/1x1trans.gif" width="10" height="1" alt="" border="0"></td>

<td valign="top">

<table border="0" cellspacing="0" cellpadding="1" bgcolor="#000000">

<tr>

<td class="titlewhite" height="21" valign="bottom">

</td>

</tr>

<tr bgcolor="#FFFFFF">

<td>

<table border="0" cellspacing="0" cellpadding="0" width="385" bgcolor="#FFFFFF">

<tr>

<td><img src="../images/1x1trans.gif" width="20" height="1" alt="" border="0"></td>

<td>

<form name="login" autocomplete="off" method="POST" ACTION="login.fcc">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td align="left">&nbsp;</td>

</tr>

<tr>

<td align="left">

<b class="title">

S3 User ID: </b>

</td>

</tr>

<tr>

<td align="left">

<input type="text" class="input" size="16" name="USER" onkeypress="checkEnter(event)">

</td>

</tr>

<tr>

<td align="left" colspan="2">

How to determine what your User ID is &nbsp;<A href="java script:makeRemoteLarge('../popup/enter_id.jsp')" tabindex="-1">

more ..</A><br>&nbsp;<br>

</td>

</tr>

<tr>

<td align="left">

<b class="title">

Password :</b>

</td>

</tr>

<tr>

<td align="left">

<input type="password" class="input" size="16" name="PASSWORD" onkeypress='checkCapsLock( event, "Caps Lock is On.\n\nHaving Caps Lock on may cause you to enter your password incorrectly.\n\nYou should press Caps Lock to turn it off before entering your password. "); checkEnter(event)'>

<input type=hidden name=target value="http://xww.docushare.world.xerox.com/dsweb/HomePage/dscgi/ds.py/PROPFIND/Server">

</td>

</tr>

<tr>

<td align="left" colspan="2">

Password must contain at least 7 case-sensitive characters <br>

Password must contain various types of characters &nbsp;<A href="java script:makeRemoteLarge('../popup/enter_pw.jsp')" tab

index="-1">

more ..</A>

</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

<tr>

<td align="left">

<a href="../crreset/forgot_password.jsp?s3status=FORGOT">Forgot your password ? ...</a>

</td>

<td align="right" >

<input type="button" name="enter" value=" Enter " class="greenButton" onclick="java script:validate()">

</td>

</tr>

</table>

</form>

</td>

<td><img src="../images/1x1trans.gif" width="7" height="1" alt="" border="0"></td>

</tr>

</table>

</td>

</tr>

</table>

<img src="../images/1x1trans.gif" width="1" height="6" alt="" border="0"><br>

<img src="../images/1x1trans.gif" width="1" height="12" alt="" border="0"><br>

<table border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" width="330">

<tr>

<td><img src="../images/1x1trans.gif" width="15" height="1" alt="" border="0"></td>

<td>

<table border="0" cellspacing="0" cellpadding="1" bgcolor="#FFFFFF">

<tr>

<td valign="bottom" colspan="2"><img src="../images/1x1trans.gif" width="1" height="4" alt="" border="0"><br><b>Action </b></td>

<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td valign="bottom" colspan="2"><img src="../images/1x1trans.gif" width="1" height="10" alt="" border="0"><br><b>Help </b></td>

</tr>

<tr>

<td valign="top"><a href="../activation/account_activation_start.jsp"><img src="../images/dialdot.gif" width="17" height="15" alt="bullet" border="0"></a></td>

<td valign="top"><a href="../activation/account_activation_start.jsp"><font color="#4F4F4F">S3 Account Activation </font></a></td>

<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td valign="top"><a href="java script: makeRemote2('../popup/s3helpdesk.jsp',785,500)"><img src="../images/dialdot.gif" width="17" height="15" alt="bullet" border="0"></a></td>

<td valign="top"><a href="java script: makeRemote2('../popup/s3helpdesk.jsp',785,500)"><font color="#4F4F4F">S3 Help Desk </font></a></td>

</tr>

<tr>

<td valign="top"><a href="../crreset/forgot_password.jsp?s3status=LOCKED"><img src="../images/dialdot.gif" width="17" height="15" alt="bullet" border="0"></a></td>

<td valign="top"><a href="../crreset/forgot_password.jsp?s3status=LOCKED"><font color="#4F4F4F">Unlock S3 Account </font></a></td>

<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td valign="top"><a href="java script: makeRemoteLarge('../popup/whats_new.jsp')"><img src="../images/dialdot.gif" width="17" height="15" alt="bullet" border="0"></a></td>

<td valign="top"><a href="java script: makeRemoteLarge('../popup/whats_new.jsp')"><font color="#4F4F4F">What's New </font></a></td>

</tr>

<tr>

<td valign="top"><a href="../pwreset/password_change.jsp"><img src="../images/dialdot.gif" width="17" height="15" alt="bullet" border="0"></a></td>

<td valign="top"><a href="../pwreset/password_change.jsp"><font color="#4F4F4F">Change your S3 password </font></a></td>

<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td valign="top"><img src="../images/1x1trans.gif" width="1" height="4" alt="" border="0"><br><a href="java script: makeRemoteLarge('http://xww.edsvalue.world.xerox.com/defaultEN.asp')"><img src="../images/dialdot.gif" width="17" height="15" alt="bullet" border="0"></a></td>

<td valign="top"><img src="../images/1x1trans.gif" width="1" height="4" alt="" border="0"><br><a href="java script: makeRemoteLarge('http://xww.edsvalue.world.xerox.com/defaultEN.asp')"><font color="#4F4F4F">eValue.</font></a></td>

<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td valign="top">&nbsp;</td>

<td valign="top">&nbsp;</td>

</tr>

<tr>

<td valign="top"><a href="../crupdate/account_update.jsp"><img src="../images/dialdot.gif" width="17" height="15" alt="bullet" border="0"></a></td>

<td valign="top"><a href="../crupdate/account_update.jsp"><font color="#4F4F4F">Change directory properties </font></a></td>

<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

<td valign="top">&nbsp;</td>

<td valign="top">&nbsp;</td>

</tr>

</table>

</TD> </TR>

<tr><td>&nbsp;<br></td></tr>

</TABLE>

<br>

<A href="java script:makeRemoteLarge('../popup/pns.jsp')" ><div class="legal"><font color="#ffffff">

READ THIS IMPORTANT NOTICE - PRIVACY AND SECURITY NOTICE

</div></A></FONT><br>

<A href="java script:makeRemote2('http://www.xerox.com/go/xrx/template/004.jsp?view=Legal&Xcntry=USA&Xlang=en_US',785,500)" >

<DIV class="legal"><FONT color="#ffffff">

&copy; 2004, XEROX CORPORATION. All rights reserved

</DIV></FONT></A>

<br>

</td>

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

</table>

</BODY>

</HTML>

Edited by pootie tang

Share this post


Link to post
Share on other sites
pootie tang

I figured out a little more about this. It appears that the call for .parentwindow is returning a COM Error which is tied to a "Access Denied." I did find another person who ran into a similar issue (http://www.autoitscript.com/forum/index.php?showtopic=51983&hl=IDispatch) but I couldn't tell if there was any progress made since then to be able to handle this particular case. Thanks in advance for any help that can be provided

Share this post


Link to post
Share on other sites
DaleHohm

You may ha figured this out already, but if you add _IEErrorHandlerRegister to your code, you'll see that Access is Denied error in the SciTe console.

This error is almost always cause by the cross-domain security restriction imposed by browsers for frames and iFrames. To avoid it, you must open the url of the desired frame in a new window.

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
pootie tang

You may ha figured this out already, but if you add _IEErrorHandlerRegister to your code, you'll see that Access is Denied error in the SciTe console.

This error is almost always cause by the cross-domain security restriction imposed by browsers for frames and iFrames. To avoid it, you must open the url of the desired frame in a new window.

Dale

Thanks Dale. I will give it a shot

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  

×