Sign in to follow this  
Followers 0
KaFu

_IEDocWriteHTML() and return immediately?

8 posts in this topic

Hi Forum,

I use the _IEDocWriteHTML() function in my program SMF to display duplicate picture files. Now I experienced that with large gif files (~1MB) which I resize to cover the whole 350x350 pixels pre-defined for the browser the display speed and program responsiveness stalls dramatically. The program does not crash, but it takes a hell lot of time for it to respond. I use a line of code as follows:

_IEDocWriteHTML($oIE[$y], $html_body_and_style & '<table><tr><td style="position:absolute;top:0px;text-align:center;vertical-align:middle;margin:0px;padding:0px;width:350px;height:350px;border:0pt solid #000000;"><img src="' & FileGetShortName($dups_result[$y]) & '"></td></tr></table>')

Now my guess is, that AU waits for the page to finish rendering. Is there a way to return return immediately after _IEDocWriteHTML() like with the $f_wait option in _IENavigate() ?

Best Regards

Share this post


Link to post
Share on other sites



Hi Forum,

I use the _IEDocWriteHTML() function in my program SMF to display duplicate picture files. Now I experienced that with large gif files (~1MB) which I resize to cover the whole 350x350 pixels pre-defined for the browser the display speed and program responsiveness stalls dramatically. The program does not crash, but it takes a hell lot of time for it to respond. I use a line of code as follows:

_IEDocWriteHTML($oIE[$y], $html_body_and_style & '<table><tr><td style="position:absolute;top:0px;text-align:center;vertical-align:middle;margin:0px;padding:0px;width:350px;height:350px;border:0pt solid #000000;"><img src="' & FileGetShortName($dups_result[$y]) & '"></td></tr></table>')

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

#3 ·  Posted (edited)

Thanks for the hint, but after tracking it yesterday evening in the include to this part...

$o_object.document.Write($s_html)
$o_object.document.close()oÝ÷ ٩ݶ¼¢hr¦z{hºÛazw±¶X§y«­¢+Øí}%1½]¥Ð ÀÌØí½QµÀ¤oÝ÷ ÚìzÛb®¶­seôTÆöEvEFÖV÷WBoÝ÷ Ù·¢·°¢é]mÂä÷®Ø^­íý²z(¶«Á¬­©ÚÂäjº.Ó©¦"µëh¶¬ CZ¾(µëzk-£
+­«­¢+ØÀÌØí½}½©Ð¹¹Ù¥Ñ

so I guess thats where the difference kicks in an why setting the timeout for _IEDocWriteHTML() would not work as expected. As next thing I will write the HTML to a temp file and give it a try. Will post an example later this day (and also hopefully a work-around :))

Thanks for the help Dale.

Best Regards

Edited by KaFu

Share this post


Link to post
Share on other sites

I really don't understand what you just said.

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

Share this post


Link to post
Share on other sites

So, i compiled two test-scripts demonstrating what I meant:

www.funk.eu/Test_IEDocWriteHTML.zip

Sadly it seems that _IENavigate() shows the same behavior :)... in the beginning the GUI is still responsive, but wait some 5 to 10 seconds an then click the Test MsgBox Button and you'll see that the GUI has stalled. I fear the resizeing of the gif just takes too much computing power and makes the embedded IE unresponsive. But I think there should be a way to unlink the GUI from IE's unresponsivness...

Best Regards

Share this post


Link to post
Share on other sites

It is GUIGetMsg() that is stalling out. Oddly, if you fully occlude the AitoIt GUI it starts polling and processing again [just stick this before the WEnd to see evidence: ConsoleWrite(".")].

This is in the GUI code. I don't have any further ideas.

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

Dale, thanks for looking into it. As a workaround I'll use something like this

$filename = @ScriptDir & '\homer.gif'
$html_body_and_style = '<body style="font:11px arial,verdana;margin:0px;padding:0px;"><meta http-equiv="content-type" content="application/xhtml+xml;charset=utf-8" />'
_IEDocWriteHTML($oIE, $html_body_and_style & '<table><tr><td style="position:absolute;top:0px;text-align:center;vertical-align:middle;margin:0px;padding:0px;width:480px;height:480px;border:0pt solid #000000;"><img style="width:480px;height:480px;" src="' & $filename & '"></td></tr></table>')
if StringInStr(stringright($filename,4),".gif") then _IEAction ($oIE, "stop")

If the file-extension is .gif I send a stop command to the IE. This way at least the GUI stays responsive.

Guess I'll fill a bug report with this one.

Best Regards

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  
Followers 0