Jump to content

Help me pls with YHTMLContainer


dburner
 Share

Recommended Posts

Helo im having problems reading text from a YHTMLContainer control(a Yahoo Messenger conversation window). I want to read the text then send it with TCPSend.

I readed a post with a similar problem on this forum but no one could find an answer :) . That post was from 2005. I hope a solution for this problem was found because AutoIt got better.

Link to comment
Share on other sites

I found a this scipt on the internet that should get the text from a YHTML Container, the problem is that its in VB code and I dont know how to "convert it" to AutoIt3. Someone please help me converting it.

Dim imclass As Long
               Dim yhtmlcontainer As Long
                Dim internetexplorerserver As Long
             imclass = FindWindow("imclass", vbNullString)
             yhtmlcontainer = FindWindowEx(imclass, 0&, "yhtmlcontainer", vbNullString) 
             internetexplorerserver = FindWindowEx(yhtmlcontainer, 0&, "internet explorer_server", vbNullString)
             Call SendMessageByString(internetexplorerserver, WM_SETTEXT, 0&, TextBox1.Text) 
             If internetexplorerserver = 0 Then
                     MsgBox("No Window Was Found! or your code is bad.")
                     Exit Sub 
              End If
      End SubEnd Class

This code was from http://www.vbforums.com/showthread.php?t=439503

Link to comment
Share on other sites

So it would appear taht it has an embedded Internet Explorer_Server control... you should be able to use _IEAttach embedded to attach to it and use _IEBodyReadHTML to get the content

If there is more than one Internet Explorer_Server control embedded, see: How to: get text from an 'Internet Explorer_Server' control http://www.autoitscript.com/forum/index.ph...mp;#entry437001

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

Link to comment
Share on other sites

I get this error when i use _IEAttach in my test code.

#include <IE.au3>

Sleep(2000)

_IEAttach("####### - Instant Message", "embedded")

D:\Programe\AutoIt3\Include\IE.au3 (4088) : ==> Subscript used with non-Array variable.: 
If IsObj($aRet[4]) Then 
If IsObj($aRet^ ERROR
>Exit code: 1   Time: 2.332

And im getting the same error when im tring to run from the example script from the help file.

>"D:\Programe\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Programe\AutoIt3\Examples\Helpfile\_IEAttach.au3"  
--> IE.au3 V2.3-1 Warning from function _IEAttach, $_IEStatus_NoMatch
--> IE.au3 V2.3-1 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType
--> IE.au3 V2.3-1 Warning from function _IEAttach, $_IEStatus_NoMatch
D:\Programe\AutoIt3\Include\IE.au3 (4088) : ==> Subscript used with non-Array variable.: 
If IsObj($aRet[4]) Then 
If IsObj($aRet^ ERROR
>Exit code: 1   Time: 2.663
Edited by dburner
Link to comment
Share on other sites

I get this error when i use _IEAttach in my test code.

#include <IE.au3>

Sleep(2000)

_IEAttach("####### - Instant Message", "embedded")

D:\Programe\AutoIt3\Include\IE.au3 (4088) : ==> Subscript used with non-Array variable.: 
If IsObj($aRet[4]) Then 
If IsObj($aRet^ ERROR
>Exit code: 1   Time: 2.332

And im getting the same error when im tring to run from the example script from the help file.

>"D:\Programe\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Programe\AutoIt3\Examples\Helpfile\_IEAttach.au3"  
--> IE.au3 V2.3-1 Warning from function _IEAttach, $_IEStatus_NoMatch
--> IE.au3 V2.3-1 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType
--> IE.au3 V2.3-1 Warning from function _IEAttach, $_IEStatus_NoMatch
D:\Programe\AutoIt3\Include\IE.au3 (4088) : ==> Subscript used with non-Array variable.: 
If IsObj($aRet[4]) Then 
If IsObj($aRet^ ERROR
>Exit code: 1   Time: 2.663
There are three examples in the helpfile. Can you please narrow it down and show code?

Can you also try running the examples without the Yahoo Messenger window running, or see if it is perhaps related to any other unique applications you are running? Also, please try logging out and back in again to insure it is not caused by a foobar iexplore process on your system.

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

Link to comment
Share on other sites

There are three examples in the helpfile. Can you please narrow it down and show code?

First i tried with all of them in the same script. And got me the error mentioned above.

Then i tried one at a time. It seems that only the last one gets an error.

#include <IE.au3>
$oIE = _IEAttach ("A Window Title", "embedded")

Gives the error

>"D:\Programe\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Ionut\Desktop\testing.au3"  
D:\Programe\AutoIt3\Include\IE.au3 (4088) : ==> Subscript used with non-Array variable.: 
If IsObj($aRet[4]) Then 
If IsObj($aRet^ ERROR
>Exit code: 1   Time: 0.353

Can you also try running the examples without the Yahoo Messenger window running

I tried but i get the same error.

Also, please try logging out and back in again to insure it is not caused by a foobar iexplore process on your system.

I tried but i get the same error.

I took a look in the IE.au3 file and I think my error comes from this funtion __IEControlGetObjFromHWND on the line

$aRet = DllCall("oleacc.dll", "int", "ObjectFromLresult", "int", $lResult, "ptr", DllStructGetPtr($typUUID), _
            "int", 0, "idispatch_ptr", "")

I made a test script and after the DllCall i used a MsgBox to display @error. @error was 2("@error = 2 unknown "return type"").

Edited by dburner
Link to comment
Share on other sites

What version of Windows?

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

Link to comment
Share on other sites

I got Windows XP Professional SP2.

Strange that on my computer it doesn't work because on my friends computer works ^_^ . I have been tring to figure out for hours why it dosen't work and still no answer. :)

Edited by dburner
Link to comment
Share on other sites

I got Windows XP Professional SP2.

Strange that on my computer it doesn't work because on my friends computer works ^_^ . I have been tring to figure out for hours why it dosen't work and still no answer. :)

It looks like it is not your problem. Thanks for doing the testing -- it looks like it is something induced by changes in the latest version of AutoIt (DllCall) that I have not adjusted for.

Sorry for time you've wasted on this -- I'll post more info as soon as we have it sorted out.

thanks,

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

Link to comment
Share on other sites

After some analysis help from Valik, it is confirmed that this is broken until we get a new version of AutoIt. I'm really surprised we didn't catch this in the beta cycle for 3.2.10.0.

There's nothing more I can do now - _IEAttach "embedded" is broken for now.

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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